【问题标题】:pyLucene InstallationpyLucene 安装
【发布时间】:2011-05-25 05:56:21
【问题描述】:

我使用的是 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

【问题讨论】:

    标签: python lucene pylucene


    【解决方案1】:

    你需要什么版本?这里有一个 2.9.2-1 的 PPA:

    https://launchpad.net/~owenmorris/+archive/ppa

    【讨论】:

    • 问题中提到-@inception使用了pylucene 3.0.1的版本
    • @MovieYoda:他尝试过的版本可能不是他需要的版本。
    【解决方案2】:

    我认为问题可能在于该补丁适用于 setuptools 0.6-11,并且您从发行版的软件包中安装了较早版本的 setuptools(可能是 0.6-10)。

    我遇到了类似的问题,通过删除发行版安装的 setuptools 版本并安装您自己从 http://pypi.python.org/pypi/setuptools 下载的版本解决了

    我还没有遇到任何问题,但是这会干扰您系统上的某些其他程序的可能性很小。

    【讨论】:

    • 我认为这可能是错误的!我认为使用较新的 setuptools 您根本不需要补丁。
    • 或者以上都不是,直接从你的包管理器安装 JCC
    • 其实你确实需要补丁,即使是0.6.11c版本
    猜你喜欢
    • 1970-01-01
    • 2021-05-31
    • 1970-01-01
    • 1970-01-01
    • 2015-09-05
    • 2011-07-30
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多