Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
529 views
in Technique[技术] by (71.8m points)

installation - Installing pygame with pip: Command "python setup.py egg_info" failed with error code 1

I have only recently started to learn programming with python. Currently I am trying to install pygame but I am constantly gettting the same error:

C:WINDOWSsystem32>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:usersfilipappdatalocalemppip-build-0xsf1bpygamesetup.py", line 165, in <module>
    extensions = read_setup_file('Setup')
  File "C:Python33libdistutilsextension.py", line 164, in read_setup_file
    line = expand_makefile_vars(line, vars)
  File "C:Python33libdistutilssysconfig.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:usersfilipappdatalocalemppip-build-0xsf1bpygame

I already went through a number of posts with similar problems but none of them had the exactly same issue, and/or they were concerned with different packages and operating systems. Moreover, I tried a couple of solutions to those problems but nothing worked for me (i tried upgrading pip, installing with easy_install and some other options I, unfortunately, cannot even recall at this point...).

I would be sincerely grateful if someone can help me with this problem. I am aware that it is possibly an irrelevant or "newbie" question, but I honestly tried finding a solution on my own and really have no more clue what to do. I have also never been really educated in computer science, so all of these things frustrate and confuse the hell out of me and constantly get in the way of the learning process (which is hard enough).

I am using Windows 10, python 3.3 64-bit.

Thank you!

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Another way to install pygame, which worked for me (W10 64bit, Python 3.4.5).

Head here and download the correct pygame wheel file for your version. Then, from cmd, go to the directory the file is in, and type pip install [COMPLETE EXACT FILENAME].

Good luck!


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...