2012-12-17 52 views
1

關於在Mac上安裝Pygame有一些未解決的問題,但我會在這裏問我的具體問題,希望得到答案。在Mac上安裝Pygame到Enthought build

我一直有令人難以置信的困難安裝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) 

我已經成功安裝了額外的模塊到這個版本使用皮普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 

回答

1

是否已安裝的Xcode 4.5的Command Line Tools組成部分?啓動Xcode.app,然後選擇PreferencesDownloadsComponents並點擊InstallUpdate。這將在像/usr/bin這樣的傳統位置安裝或更新構建工具和系統標頭。

+0

謝謝!在10秒內工作。我無法相信我在這樣一個愚蠢的問題上掙扎了多久。 –

+0

你並不孤單。蘋果沒有任何人讓Xcode.app默認不安裝命令行工具。 –