我正在尝试安装python的pygame库,要做到这一点,我在Windows的CMD中使用了pip install pygame
,但随后出现此错误。
Collecting pygame
Using cached pygame-1.9.6.tar.gz (3.2 MB)
ERROR: Command errored out with exit status 1:
command: 'c:\users\marcg\appdata\local\programs\python\python39\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\marcg\\AppData\\Local\\Temp\\pip-install-c1fzrnpr\\pygame\\setup.py'"'"'; __file__='"'"'C:\\Users\\marcg\\AppData\\Local\\Temp\\pip-install-c1fzrnpr\\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\marcg\AppData\Local\Temp\pip-pip-egg-info-07h2j4on'
cwd: C:\Users\marcg\AppData\Local\Temp\pip-install-c1fzrnpr\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\marcg\AppData\Local\Temp\pip-install-c1fzrnpr\pygame\setup.py", line 194, in <module>
buildconfig.config.main(AUTO_CONFIG)
File "C:\Users\marcg\AppData\Local\Temp\pip-install-c1fzrnpr\pygame\buildconfig\config.py", line 210, in main
deps = CFG.main(**kwds)
File "C:\Users\marcg\AppData\Local\Temp\pip-install-c1fzrnpr\pygame\buildconfig\config_win.py", line 576, in main
and download_win_prebuilt.ask(**download_kwargs):
File "C:\Users\marcg\AppData\Local\Temp\pip-install-c1fzrnpr\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.
有人可以帮助我吗?
答案 0 :(得分:0)
您可以在安装pygame之前尝试在Date_Field
之前安装wheel,以便它使用已编译的软件包而不是尝试构建它。
答案 1 :(得分:0)
更新:Windows用户请使用python3
代替pip
,并使用pip3
代替pip3 uninstall pygame
尝试python3 -m pip install -U pygame==2.0.0 --user
然后是python3 -m pygame.examples.aliens
要查看其是否有效,请运行包含的示例之一:
pip3
如果收到“ PermissionError:[WinError 5]访问被拒绝”,请在启动命令提示符之前右键单击并单击“以管理员身份运行”。
如果没有pip
,请使用Unhandled Promise Rejection: TypeError: Request has method 'GET' and cannot have a body
确保点已更新。 看这个视频 https://www.youtube.com/watch?v=ABe_qpzQu0Q了解有关更新点的信息
答案 2 :(得分:0)
Python 3.8不支持最新的1.9.6 pygame ... 试试:
python3 -m pip install pygame==2.0.0.dev6