Home >Backend Development >Python Tutorial >How to install pygame in python
How to install pygame in python? The specific steps are as follows:
1. Go to the official website to download PyGame
Note: You need to download the corresponding version of the package
Official website address: http://www.pygame.org/download.shtml
Among them , if python is the following version:
python 3.4: http://www.lfd.uci.edu/~gohlke/pythonlibs/#pygame
python 3.5, 3.6: https ://pypi.python.org/pypi/Pygame
(cp36 means python3.6)
2. Install directly from the .exe file
.whl file starts the doc command installation:
Open the doc interface at the location of the file: (win10 directly holds shift in the blank space of the current folder and right-clicks to open the powershell window)
Related recommendations: "Python Video Tutorial"
Enter the following instructions to install:
pip install pygame-1.9.3-cp36-cp36m-win32.whl
3. Test the installation results
4. Problem
Two problems occurred during the installation process:
1) You are using pip version 9.0.1, however version 10.0.1 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.
Reason: This problem mainly means that the version has not been updated. , just update it
Solution: Enter python -m pip install --upgrade pip command and just update it
2) pygame-1.9.3-cp36-cp36m-win_amd64 .whl is not a supported wheel on this platform.
Cause: The version does not correspond
Solution:
Check whether the correct correspondence has been downloaded : python version, 32 or 64 bit
The above is the detailed content of How to install pygame in python. For more information, please follow other related articles on the PHP Chinese website!