I can't install the Python module " Pygame"
C:\Users\mapk0>pip install pygame
Collecting pygame
Using cached https://files.pythonhosted.org/packages/0f/9c/78626be04e193c0624842090fe5555b3805c050dfaa81c8094d6441db2be/pygame-1.9.6.tar.gz
ERROR: Command errored out with exit status 1:
command: 'c:\users\mapk0\appdata\local\programs\python\python38\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\mapk0\\AppData\\Local\\Temp\\pip-install-uxamm092\\pygame\\setup.py'"'"'; __file__='"'"'C:\\Users\\mapk0\\AppData\\Local\\Temp\\pip-install-uxamm092\\pygame\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\mapk0\AppData\Local\Temp\pip-install-uxamm092\pygame\pip-egg-info'
cwd: C:\Users\mapk0\AppData\Local\Temp\pip-install-uxamm092\pygame\
Complete output (17 lines):
WARNING, No "Setup" File Exists, Running "buildconfig/config.py"
Using WINDOWS configuration...
Download prebuilts to "prebuilt_downloads" and copy to "./prebuilt-x64"? [Y/n]Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\mapk0\AppData\Local\Temp\pip-install-uxamm092\pygame\setup.py", line 194, in <module>
buildconfig.config.main(AUTO_CONFIG)
File "C:\Users\mapk0\AppData\Local\Temp\pip-install-uxamm092\pygame\buildconfig\config.py", line 210, in main
deps = CFG.main(**kwds)
File "C:\Users\mapk0\AppData\Local\Temp\pip-install-uxamm092\pygame\buildconfig\config_win.py", line 576, in main
and download_win_prebuilt.ask(**download_kwargs):
File "C:\Users\mapk0\AppData\Local\Temp\pip-install-uxamm092\pygame\buildconfig\download_win_prebuilt.py", line 302, in ask
reply = raw_input(
EOFError: EOF when reading a line
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
3 answers
Python 3.8 does not support pygame yet download python 3.7.x and everything will be installed normally. Reference to python 3.7.5 -- https://www.python.org/downloads/release/python-375/ - latest release version 3.7
Judging by
command: 'c:\users\mapk0\appdata\local\programs\python\python38
This is python 3.8
. (Next time, please specify the versions of all components)
A similar question about python 3.8
and pygame
was asked recently on stackoverflow.
Here is a short retelling of the answer, which I find useful, in case you don't understand English:
pip
actually, he's not friends with pygame
.
But it can be compiled using the instructions from here: https://www.pygame.org/wiki/CompileWindows (eng.)
When however, to install with version 3.8, you need to use pygame 2.0.0
and the instructions under the SDL2 header.
If you manage to install pygame
using these instructions, it is advisable to vote for the 2nd answer in the original question. Or leave a comment here and I'll vote for it.
To install pygame, you need python 3.7, which you can download from https://www.python.org/ftp/python/3.7.9/python-3.7.9-amd64.exe