Python 模块:在 Mac OSX 10.7.4 上安装 Bitarray 0.8.0 时遇到问题

Python 模块:在 Mac OSX 10.7.4 上安装 Bitarray 0.8.0 时遇到问题

bitarray我在 Mac OSX 10.7.4 上安装(版本 0.8.0)时遇到问题。谢谢!

gcc似乎不是问题:

Last login: Sun Sep  9 22:24:25 on ttys000
host-001:~ gabriele$ gcc -version
i686-apple-darwin11-llvm-gcc-4.2: no input files
host-001:~ gabriele$ 

Last login: Sun Sep  9 22:18:41 on ttys000
host-001:~ gabriele$ cd /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/bitarray-0.8.0/
host-001:bitarray-0.8.0 gabriele$ python2.7 setup.py installrunning install
running bdist_egg
running egg_info
creating bitarray.egg-info
writing bitarray.egg-info/PKG-INFO
writing top-level names to bitarray.egg-info/top_level.txt
writing dependency_links to bitarray.egg-info/dependency_links.txt
writing manifest file 'bitarray.egg-info/SOURCES.txt'
reading manifest file 'bitarray.egg-info/SOURCES.txt'
writing manifest file 'bitarray.egg-info/SOURCES.txt'
installing library code to build/bdist.macosx-10.6-intel/egg
running install_lib
running build_py
creating build
creating build/lib.macosx-10.6-intel-2.7
creating build/lib.macosx-10.6-intel-2.7/bitarray
copying bitarray/__init__.py -> build/lib.macosx-10.6-intel-2.7/bitarray
copying bitarray/test_bitarray.py -> build/lib.macosx-10.6-intel-2.7/bitarray
running build_ext
building 'bitarray._bitarray' extension
creating build/temp.macosx-10.6-intel-2.7
creating build/temp.macosx-10.6-intel-2.7/bitarray
gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -isysroot /Developer/SDKs/MacOSX10.6.sdk -arch i386 -arch x86_64 -g -O2 -DNDEBUG -g -O3 -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c bitarray/_bitarray.c -o build/temp.macosx-10.6-intel-2.7/bitarray/_bitarray.o
unable to execute gcc-4.2: No such file or directory
error: command 'gcc-4.2' failed with exit status 1
host-001:bitarray-0.8.0 gabriele$

答案1

安装程序正在尝试运行命令gcc-4.2,但该命令似乎不存在于您的系统中。请通过运行which gcc-4.2或进行验证locate gcc-4.2(您可能需要/usr/libexec/locate.updatedb先运行才能使用后一个命令)。如果不存在,只需在二进制文件所在的同一目录中创建一个符号链接gcc

cd $(dirname $(which gcc))
sudo ln -s gcc gcc-4.2

相关内容