Can't install pygame with pip for Python 3.7 -

2019-01-15 22:26发布

问题:

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.

回答1:

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.



回答2:

Try :

pip install --upgrade setuptools