سؤال

I am on Ubuntu 10.04, Python 2.6.5 & having some trouble installing pyLucene.

Here's what I have done so far, installed these packages -

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

After that got the source code of pyLucene from http://www.apache.org/dyn/closer.cgi/lucene/pylucene/. I got version pylucene-3.0.1-1.

Untared it. Since JCC needs to be built first; went to JCC dir & then typed python setup.py install. got an error about some setuptools patch. it told me to do this - 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

and I did. but I got this on the terminal -

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

Now my build fails - i.e. when I do sudo python setup.py build I get -

...
error: command 'gcc' failed with exit status 1
هل كانت مفيدة؟

المحلول

What version do you need? There's a PPA with 2.9.2-1 here:

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

نصائح أخرى

I think the problem may be that the patch is for setuptools 0.6-11 and you have an earlier version of setuptools (prob 0.6-10) installed from your distro's packages.

I have had a similar problem that was resolved by removing the version of setuptools installed by the distro and installing your own downloaded from http://pypi.python.org/pypi/setuptools

I have had no problems yet, but there is a very small chance that this will interfere with some other programs on your system.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top