2013-10-12 106 views
0

我想安装以下包的Python:http://www.daimi.au.dk/~mailund/suffix_tree/ 我已经下载了存档,打开包装,并在终端中运行以下命令:Python中,无法安装软件包,Mac OS X的

python /Users/USRName/Documents/suffix_tree-2.1/setup.py install 

当执行,以下错误occures

running install 
    running build 
    running build_py 
    file suffix_tree.py (for module suffix_tree) not found 
    file suffix_tree.py (for module suffix_tree) not found 
    running build_ext 
    building '_suffix_tree' extension 
    gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -arch i386 -arch x86_64 -g -O2 -DNDEBUG -g -O3  -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c python_bindings.c -o build/temp.macosx-10.6-intel-2.7/python_bindings.o 
    i686-apple-darwin11-gcc-4.2.1: python_bindings.c: No such file or directory 
    i686-apple-darwin11-gcc-4.2.1: no input files 
    i686-apple-darwin11-gcc-4.2.1: python_bindings.c: No such file or directory 
    i686-apple-darwin11-gcc-4.2.1: no input files 
    lipo: can't figure out the architecture type of:   /var/folders/z0/6_4y_75s4dxf7fkndh7rrc6r0000gn/T//ccbGRVor.out 

错误:命令 'GCC-4.2' 失败,退出状态1

能否请你坚d建议我,如何解决它?

回答

2

从错误消息中可以明显看出,您试图编译文件python-bindings.c,但该文件不存在于当前目录中,可能是因为您正在从其他地方运行setup.py脚本。

所以你应该先cd /Users/USRName/Documents/suffix_tree-2.1/然后运行python setup.py

+0

谢谢。有效。 –