How do I install pygame on python 3.6?
How do I install pygame on python 3.6?
Here is how I installed pygame on my Windows 10 Home 64 bit system with Python 3.6. (I installed Python through Anaconda but this should also work if you used python.org.)
-
Download the latest version of pygame, 1.9.3, from https://pypi.python.org/pypi/Pygame/1.9.3. For the system I described the proper file is
pygame-1.9.3-cp36-cp36m-win_amd64.whl.
(That file is near the bottom of the list on the given page. Despite the amd in the file name, that is not just for AMD processors but for any 64-bit Windows 10.) Save the file to a directory you can reach with the Windows command line (also called the DOS box) or Windows PowerShell as an administrator.
- Open a Windows command line (DOS box) or PowerShell in that directory as an administrator. One way to do that is to open that directory in File Explorer, click the File tab on the far left near the top, hover the mouse over Open Windows PowerShell, then click Open Windows PowerShell as Administrator. Another way is to press Windows-R, enter cmd.exe, and cd to the proper directory.
-
In the command line/DOS box/PowerShell window, enter the command
pip install pygame-1.9.3-cp36-cp36m-win_amd64.whl
-
Test the installation by opening Python and entering
import pygame
On Linux, download the appropriate whl file from https://pypi.python.org/pypi/Pygame/1.9.3, extract it to the folder where you have python site-packages, and you are done.