7

I get the below error when trying to install pygame with pip:

Command "python setup.py egg_info" failed with error code 1 in 
C:\Users\danie\AppData\Local\Temp\pip-install-8zxzuqef\pygame\

I don't know what this means, and when i look up in other places to tells me to fix my environment variables. But it still doesn't work.

skrx
  • 19,980
  • 5
  • 34
  • 48
dPatt
  • 73
  • 1
  • 1
  • 6
  • How exactly are you trying to install pygame? Which operating system and Python version do you use? – skrx Jul 02 '18 at 15:50
  • @skrx Using Windows 10, python 3.7. Aand i'm not sure what you mean by "How exactly are you trying to install pygame" I thought tehre was only method. – dPatt Jul 02 '18 at 15:53
  • There are different methods. – skrx Jul 02 '18 at 15:55
  • @skrx Well I downloaded python, downloaded and installed pip and then did "pip install pygame" and thats how far i got to. – dPatt Jul 02 '18 at 15:57
  • try this https://stackoverflow.com/questions/35991403/pip-install-unroll-python-setup-py-egg-info-failed-with-error-code-1 – Nipun Thennakoon Jul 02 '18 at 15:58
  • @NipunSampath I've been to that exact post before i posted this. Didnt help. – dPatt Jul 02 '18 at 16:02

3 Answers3

3

Update: Pygame 1.9.4 has been released and you can download and install it with pip again. In Windows I recommend installing it with: py -3.7 -m pip install pygame


There are no official precompiled pygame packages for Python 3.7 available yet, so pip install pygame doesn't work, but you can get a pygame wheel from: https://www.lfd.uci.edu/~gohlke/pythonlibs/#pygame

Download pygame‑1.9.3‑cp37‑cp37m‑win_amd64.whl if you have a 64-bit Python version or pygame‑1.9.3‑cp37‑cp37m‑win32.whl if you have a 32-bit version. Then open the command-line, navigate to the directory that contains the wheel file and install it with pip:

py -3.7 -m pip install pygame‑1.9.3‑cp37‑cp37m‑win_amd64.whl

This solution works only in Windows, so users with other operating systems have to wait and use Python 3.6.

skrx
  • 19,980
  • 5
  • 34
  • 48
  • "Then open the command-line navigate to the directory that contains the wheel file and install it with pip" Not sure how to do this :/ – dPatt Jul 02 '18 at 16:03
  • Enter `cd path_to_the_directory` (replace `path_to_the_directory` with the actual path to your download directory). – skrx Jul 02 '18 at 16:06
  • Great! I think it's worked. Thank you for your help. – dPatt Jul 02 '18 at 16:12
0

On debian

sudo apt-get install python3-pygame

works.

NewAgeA
  • 61
  • 5
-2

Try :

py -3.7 -m pip install pygame
Ojas Kale
  • 2,067
  • 2
  • 24
  • 39
  • 1
    Tried This and i get: Requirement already up-to-date: setuptools in c:\users\danie\appdata\local\programs\python\python37-32\lib\site-packages (39.2.0) Still no luck after that though. – dPatt Jul 02 '18 at 15:53
  • I dont know why people gave you dislikes it worked for me as I am having trouble with pip – Siddharth Agrawal Sep 26 '20 at 11:08