在Mac上安装Pygame时有很多未解答的问题,但我会在这里提出我的具体问题并希望得到答案。
我在将Pygame安装到Mac上时遇到了难以置信的困难。我使用Enthought版本的EPD 7.3-2 32位,它是我的默认框架,所以如果我在终端提示符下键入python
,我得到:
$ python
Enthought Python Distribution (EPD) free version -- www.enthought.com
Version: 7.3-2 (32-bit)
我已经使用Pip 1.2.1成功地为此版本安装了其他模块,没有任何问题。我在我的机器上安装了Xcode 4.5.2,但是我收到gcc错误。
有什么想法吗?
这是跟踪:
$ pip install Pygame
Downloading/unpacking Pygame
Running setup.py egg_info for package Pygame
warning: no files found matching 'readme.txt'
no previously-included directories found matching '*/CVS'
no previously-included directories found matching '*/*/CVS'
Installing collected packages: Pygame
Running setup.py install for Pygame
building 'pygame.font' extension
gcc -fno-strict-aliasing -fno-common -dynamic -arch i386 -DNDEBUG -g -O3 -arch i386 -Ddarwin -I/Library/Frameworks/SDL.framework/Versions/Current/Headers -I/Library/Frameworks/SDL_ttf.framework/Versions/Current/Headers -I/Library/Frameworks/Python.framework/Versions/7.3/include/python2.7 -c src/font.c -o build/temp.macosx-10.5-i386-2.7/src/font.o
unable to execute gcc: No such file or directory
error: command 'gcc' failed with exit status 1
Complete output from command /Library/Frameworks/Python.framework/Versions/7.3/Resources/Python.app/Contents/MacOS/Python -c "import setuptools;__file__='/var/folders/7p/wns1bszn1gq0zm3z2j_tdkdw0000gn/T/pip-build/Pygame/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/7p/wns1bszn1gq0zm3z2j_tdkdw0000gn/T/pip-478PM0-record/install-record.txt --single-version-externally-managed:
running install
running build
running build_py
running build_ext
building 'pygame.font' extension
gcc -fno-strict-aliasing -fno-common -dynamic -arch i386 -DNDEBUG -g -O3 -arch i386 -Ddarwin -I/Library/Frameworks/SDL.framework/Versions/Current/Headers -I/Library/Frameworks/SDL_ttf.framework/Versions/Current/Headers -I/Library/Frameworks/Python.framework/Versions/7.3/include/python2.7 -c src/font.c -o build/temp.macosx-10.5-i386-2.7/src/font.o
unable to execute gcc: No such file or directory
error: command 'gcc' failed with exit status 1
----------------------------------------
Command /Library/Frameworks/Python.framework/Versions/7.3/Resources/Python.app/Contents/MacOS/Python -c "import setuptools;__file__='/var/folders/7p/wns1bszn1gq0zm3z2j_tdkdw0000gn/T/pip-build/Pygame/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/7p/wns1bszn1gq0zm3z2j_tdkdw0000gn/T/pip-478PM0-record/install-record.txt --single-version-externally-managed failed with error code 1 in /var/folders/7p/wns1bszn1gq0zm3z2j_tdkdw0000gn/T/pip-build/Pygame
Storing complete log in /Users/jchirico/.pip/pip.log
答案 0 :(得分:1)
您是否安装了Xcode 4.5的Command Line Tools
组件?启动Xcode.app
,然后选择Preferences
- > Downloads
- > Components
并点击Install
或Update
。这将在/usr/bin
等传统位置安装或更新构建工具和系统标头。