Python,无法安装包,Mac OS X.

时间:2013-10-12 21:10:34

标签: python packages

我想为Python安装以下软件包:http://www.daimi.au.dk/~mailund/suffix_tree/ 我已经下载了存档,解压缩并在终端中运行以下命令:

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

执行时,会发生以下错误

  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而失败

你会如此善意地建议我,如何解决它?

1 个答案:

答案 0 :(得分:2)

从错误消息中可以清楚地看到,您试图编译文件python-bindings.c,但当前目录中不存在该文件,可能是因为您从某处运行setup.py脚本其他

因此,您应首先cd /Users/USRName/Documents/suffix_tree-2.1/然后运行python setup.py