我在 Ubuntu 10.04、Python 2.6.5 上安装 pyLucene 时遇到了一些问题。
这是我到目前为止所做的,安装了这些软件包 -
sudo apt-get install ant
sudo apt-get install sun-java6-jdk
sudo update-java-alternatives -s java-1.5.0-sun
sudo apt-get install gcc
sudo apt-get install g++
sudo apt-get install gcj
sudo apt-get install python-dev
之后从http://www.apache.org/dyn/closer.cgi/lucene/pylucene/获得 pyLucene 的源代码。我得到了 pylucene-3.0.1-1 版本。
解压它。由于需要先建JCC;转到 JCC 目录,然后输入python setup.py install
. 收到有关某些 setuptools 补丁的错误。它告诉我这样做 -
sudo patch -d /usr/lib/python2.6/dist-packages -Nup0 < /home/code/python/lucene/pylucene-3.0.1-1/jcc/jcc/patches/patch.43.0.6c11
我做到了。但我在终端上得到了这个 -
patching file setuptools/extension.py
patching file setuptools/command/build_ext.py
Hunk #1 FAILED at 85.
Hunk #2 succeeded at 177 (offset 7 lines).
Hunk #3 succeeded at 259 (offset 7 lines).
1 out of 3 hunks FAILED -- saving rejects to file setuptools/command/build_ext.py.rej
现在我的构建失败了——即当我这样做时sudo python setup.py build
——
...
error: command 'gcc' failed with exit status 1