So I am having a bit of trouble with my python/pygame. I want to install pygame but i just dont know how to do it. I have been looking around on the web now for a while and tried multiple things. It just does not work...
-
1what's wrong with the pip install? – Constantin Guidon Sep 03 '17 at 10:39
-
1Which operating system do you use? How did you install Python 3.6--from python.org, through Anaconda, or something else? – Rory Daulton Sep 03 '17 at 10:45
-
i tried to use the pip install but it simply doesnt work. It does nothing. – Wouter van den brandt Sep 03 '17 at 10:55
-
I use windows 10 64 bit and i installed python through python.org @RoryDaulton – Wouter van den brandt Sep 03 '17 at 10:56
-
Here's some [tips](https://stackoverflow.com/questions/35991403/python-pip-install-gives-command-python-setup-py-egg-info-failed-with-error-c/39155105#39155105) I use to install python packages, hope it helps – BPL Sep 03 '17 at 12:15
-
When you say `pip install` does "nothing", what do you mean? I doubt it just returns 0. Is there any console output? Do you get any error messages? A timeout? Please read [ask]. – ChrisGPT was on strike Sep 03 '17 at 12:38
-
Check out [this answer](https://stackoverflow.com/a/42663743/6220679). – skrx Sep 03 '17 at 12:56
-
The cause of your problems is most likely that the `/Scripts` directory which contains `pip` was not added to the PATH variable during the installation, so you can't just type `pip install name_of_the_package` in the command-line. – skrx Sep 03 '17 at 13:03
-
Don't give up. Try to enter `py -3.6 -m pip install pygame`, since that's the least error prone way to install pygame. – skrx Sep 03 '17 at 22:39
3 Answers
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

- 21,934
- 6
- 42
- 50
-
PS C:\Program Files\Python36> pip install pygame-1.9.3-cp36-cp36m-win_amd64.whl pip : The term 'pip' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. At line:1 char:1 + pip install pygame-1.9.3-cp36-cp36m-win_amd64.whl + ~~~ + CategoryInfo : ObjectNotFound: (pip:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException – Wouter van den brandt Sep 03 '17 at 11:31
-
i dont know where i have to save the file so i think that is the problem – Wouter van den brandt Sep 03 '17 at 11:32
-
Something seems to be wrong with your Python installation if `pip` is not accessible. Try finding `pip` by opening a DOS box and running `dir C:\pip.exe /s`. When you find its location, save the pygame file there and try again in that directory. If you cannot find pip then try re-installing Python. – Rory Daulton Sep 03 '17 at 11:48
-
i have been trying for over an hour and my pc is just not made for it i guess, i am also learning java so i might try with that – Wouter van den brandt Sep 03 '17 at 18:56
-
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.
If you're on a windows computer, you can do this:
- type
cmd
in the search bar and click enter - type
python --version
- type
pip --version
- based on what the python version said, you would use the first number. I was on version 3.10, so I used pip3. now type
pip"(python version)" install pygame
. - You'll see some text highlighted green. Copy that and paste it in the search bar, click enter.
- You should see two folders containing pygame in the file explorer.
I don't know what to do for mac.

- 13,789
- 3
- 29
- 54

- 1
- 1