目前,我无法安装任何Python包由于GCC-4.0的错误。 我会复制我得到了错误的两个例子(一个点子 ,另配备手动setup.py构建/安装方法):
sgarza62$ pip install PIL
Downloading/unpacking PIL
Running setup.py egg_info for package PIL
WARNING: '' not a valid package name; please use only.-separated package names in setup.py
Installing collected packages: PIL
Running setup.py install for PIL
WARNING: '' not a valid package name; please use only.-separated package names in setup.py
--- using frameworks at /System/Library/Frameworks
building '_imaging' extension
gcc-4.0 -fno-strict-aliasing -fno-common -dynamic -arch ppc -arch i386 -g -O2 -DNDEBUG -g -O3 -DHAVE_LIBZ -I/System/Library/Frameworks/Tcl.framework/Headers -I/System/Library/Frameworks/Tk.framework/Headers -IlibImaging -I/Library/Frameworks/Python.framework/Versions/2.7/include -I/usr/include -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c _imaging.c -o build/temp.macosx-10.3-fat-2.7/_imaging.o
unable to execute gcc-4.0: No such file or directory
error: command 'gcc-4.0' failed with exit status 1
Complete output from command /Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python -c "import setuptools;__file__='/var/folders/9q/bvqtzkbx1hg1934b36zgk0y40000gp/T/pip-build/PIL/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/9q/bvqtzkbx1hg1934b36zgk0y40000gp/T/pip-nV9YEx-record/install-record.txt --single-version-externally-managed:
WARNING: '' not a valid package name; please use only.-separated package names in setup.py
running install
running build
running build_py
running build_ext
--- using frameworks at /System/Library/Frameworks
building '_imaging' extension
gcc-4.0 -fno-strict-aliasing -fno-common -dynamic -arch ppc -arch i386 -g -O2 -DNDEBUG -g -O3 -DHAVE_LIBZ -I/System/Library/Frameworks/Tcl.framework/Headers -I/System/Library/Frameworks/Tk.framework/Headers -IlibImaging -I/Library/Frameworks/Python.framework/Versions/2.7/include -I/usr/include -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c _imaging.c -o build/temp.macosx-10.3-fat-2.7/_imaging.o
unable to execute gcc-4.0: No such file or directory
error: command 'gcc-4.0' failed with exit status 1
sgarza62$ cd Imaging-1.1.7
sgarza62$ sudo python setup.py build
running build
running build_py
running build_ext
--- using frameworks at /System/Library/Frameworks
building '_imaging' extension
gcc-4.0 -fno-strict-aliasing -fno-common -dynamic -arch ppc -arch i386 -g -O2 -DNDEBUG -g -O3 -DHAVE_LIBZ -I/System/Library/Frameworks/Tcl.framework/Headers -I/System/Library/Frameworks/Tk.framework/Headers -IlibImaging -I/Library/Frameworks/Python.framework/Versions/2.7/include -I/usr/include -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c _imaging.c -o build/temp.macosx-10.3-fat-2.7/_imaging.o
unable to execute gcc-4.0: No such file or directory
error: command 'gcc-4.0' failed with exit status 1
这里是信息一堆,我会从终端复制,希望能有一些是在确定问题的一些建议:
sgarza62$ gcc
i686-apple-darwin11-llvm-gcc-4.2: no input files
sgarza62$ python
Python 2.7.3 (v2.7.3:70274d53c1dd, Apr 9 2012, 20:32:06)
[GCC 4.0.1 (Apple Inc. build 5493)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>>
sgarza62$ which python
/Library/Frameworks/Python.framework/Versions/2.7/bin/python
sgarza62$ echo $PATH
/Library/Frameworks/Python.framework/Versions/2.7/bin:/Library/Frameworks/Python.framework/Versions/2.7/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin
sgarza62$ /usr/bin/python -c 'import sys;print(sys.version)'
2.7.2 (default, Jun 16 2012, 12:38:40)
[GCC 4.2.1 Compatible Apple Clang 4.0 (tags/Apple/clang-418.0.60)]
sgarza62$ /usr/bin/python2.6 -c 'import sys; print(sys.version)'
2.6.7 (r267:88850, Jun 16 2012, 12:38:45)
[GCC 4.2.1 Compatible Apple Clang 4.0 (tags/Apple/clang-418.0.60)]
sgarza62$ /usr/bin/python2.5 -c 'import sys;print(sys.version)'
2.5.6 (r256:88840, Jun 16 2012, 12:38:24)
[GCC 4.2.1 Compatible Apple Clang 4.0 (tags/Apple/clang-418.0.60)]
sgarza62$ /usr/bin/python2.7 -c 'import sys;print(sys.version)'
2.7.2 (default, Jun 16 2012, 12:38:40)
[GCC 4.2.1 Compatible Apple Clang 4.0 (tags/Apple/clang-418.0.60)]
这里是堆栈解决相同或类似的问题(但没有提供一个完整的解决我的问题)的一些问题/答案。 也许这些以前的答案将是使用搞清楚这个问题:
在Mac OS 10.6蟒蛇重新安装使用不同的gcc版本
如何使用/ Mac OS X上安装gcc 10.8 / 4.4的Xcode
使用GCC的版本错误在OS X上的Python构建
这是我已经做过的事情,它已建议对类似问题叠加的用户:
下载Xcode中
在Xcode的喜好安装命令行工具
sudo ln -s /usr/bin/gcc /usr/bin/gcc-4.2
我已经做了我的问题,最好给尽可能多的事实,以清晰和有序的方式,尽可能地。 但是,如果你们需要更多的信息,请咨询! 我会很乐意与更多的细节编辑的问题。
另外,我知道这似乎是一个很具体的问题,但是从周围寻找,它看起来像其他许多人都搞不清这个问题。
如果你不介意的话,我将非常感谢一个填鸭式的解决方案(明确地说明我在码头做解决这个问题)。 我不是在终端很舒服着呢,变得有点困惑与广义的答案。
谢谢大家的时间,我很感激!