0

我想为 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

你会这么好心地建议我,如何解决它?

4

1 回答 1

2

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

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

于 2013-10-12T21:43:53.163 回答