+-

我最近才开始用 python学习编程.目前我正在尝试安装pygame,但我经常遇到同样的错误:
C:\WINDOWS\system32>python -m pip install pygame
Collecting pygame
Using cached pygame-1.9.2.tar.gz
Complete output from command python setup.py egg_info:
WARNING, No "Setup" File Exists, Running "config.py"
Using WINDOWS configuration...
Path for SDL not found.
Too bad that is a requirement! Hand-fix the "Setup"
Path for FONT not found.
Path for IMAGE not found.
Path for MIXER not found.
Path for PNG not found.
Path for JPEG not found.
Path for PORTMIDI not found.
Path for COPYLIB_tiff not found.
Path for COPYLIB_z not found.
Path for COPYLIB_vorbis not found.
Path for COPYLIB_ogg not found.
If you get compiler errors during install, doublecheck
the compiler flags in the "Setup" file.
Continuing With "setup.py"
Error with the "Setup" file,
perhaps make a clean copy from "Setup.in".
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "c:\users\filip\appdata\local\temp\pip-build-0xsf1b\pygame\setup.py", line 165, in <module>
extensions = read_setup_file('Setup')
File "C:\Python33\lib\distutils\extension.py", line 164, in read_setup_file
line = expand_makefile_vars(line, vars)
File "C:\Python33\lib\distutils\sysconfig.py", line 430, in expand_makefile_vars
s = s[0:beg] + vars.get(m.group(1)) + s[end:]
TypeError: Can't convert 'NoneType' object to str implicitly
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in c:\users\filip\appdata\local\temp\pip-build-0xsf1b\pygame\
我已经经历了许多类似问题的帖子,但没有一个问题完全相同,和/或他们关心的是不同的软件包和操作系统.此外,我尝试了几个解决这些问题的解决方案,但没有任何方法适合我(我尝试升级pip,使用easy_install和其他一些选项进行安装我很遗憾,此时甚至无法回想起……).
如果有人可以帮我解决这个问题,我将非常感激.我知道这可能是一个无关紧要或“新手”的问题,但我老老实实地试图找到一个我自己的解决方案,并且真的不知道该怎么做.我也从未真正接受过计算机科学方面的教育,因此所有这些事情都让我感到沮丧和困惑,并不断妨碍学习过程(这很难).
我使用的是Windows 10,python 3.3 64位.
谢谢!
最佳答案
另一种安装pygame的方法,对我有用(W10 64bit,Python 3.4.5).
Head here并为您的版本下载正确的pygame wheel文件.然后,从cmd,转到该文件所在的目录,并键入pip install [COMPLETE EXACT FILENAME].
祝好运!
点击查看更多相关文章
转载注明原文:使用pip安装pygame:命令“python setup.py egg_info”失败,错误代码为1 - 乐贴网