vs2017 has an independent python environment; so if you want to develop python in vs2017 and use third-party packages, you need to operate in vs2017 and complete the installation of third-party packages.
First, check which versions of python are available in vs2017 and which version are you currently using
Tools--"Python--"Python environment
You can see what versions of vs2017 include python version.
Check the python version of the current solution
## 2. Download the corresponding version of pygameDownload address: https://www.pygame.org/download.shtmlIf you do not find the version corresponding to the system, find another download address:https://www.lfd.uci. edu/~gohlke/pythonlibs/#pygame
3. Instructions to install whl package1. Open PowerShellIn the python environment interface, select the python you want to operate version, click "Start PowerShell" 2. Enter the installation commandpip install pygame-1.9.3-cp36-cp36m-win32.whlNote: Please enter the absolute path of the whl file, starting from the drive letter; C://***/***/pygame-1.9.3-cp36-cp36m-win32.whlFor more Python-related technical articles, please visit thePython tutorial column to learn!
The above is the detailed content of How to install python third-party package in vs2017. For more information, please follow other related articles on the PHP Chinese website!