Tuesday, 15 July 2014

python - Building Pylucene on ubuntu 14.04(trusty tahr) -



python - Building Pylucene on ubuntu 14.04(trusty tahr) -

as per installation instructions, jcc built.

dependencies installed were: ant, openjdk-7-jdk, python-setuptools, python-dev.

then procedding create pylucene, in "makefile" take specs corresponding ubuntu 11.

# linux (ubuntu 11.10 64-bit, python 2.7.2, openjdk 1.7, setuptools 0.6.16) # sure set jdk['linux2'] in jcc's setup.py java_home value # used below ant (and rebuild jcc after changing it). prefix_python=/usr ant=java_home=/usr/lib/jvm/java-7-openjdk-amd64 /usr/bin/ant python=$(prefix_python)/bin/python jcc=$(python) -m jcc --shared num_files=8

on executing "sudo make" command next error encountered:

/usr/bin/python -m jcc --shared --jar lucene-java-4.6.1/lucene/build/core/lucene-core-4.6.1.jar --jar lucene-java-4.6.1/lucene/build/analysis/common/lucene-analyzers-common-4.6.1.jar --jar lucene-java-4.6.1/lucene/build/memory/lucene-memory-4.6.1.jar --jar lucene-java-4.6.1/lucene/build/highlighter/lucene-highlighter-4.6.1.jar --jar build/jar/extensions.jar --jar lucene-java-4.6.1/lucene/build/queries/lucene-queries-4.6.1.jar --jar lucene-java-4.6.1/lucene/build/queryparser/lucene-queryparser-4.6.1.jar --jar lucene-java-4.6.1/lucene/build/sandbox/lucene-sandbox-4.6.1.jar --jar lucene-java-4.6.1/lucene/build/analysis/stempel/lucene-analyzers-stempel-4.6.1.jar --jar lucene-java-4.6.1/lucene/build/grouping/lucene-grouping-4.6.1.jar --jar lucene-java-4.6.1/lucene/build/join/lucene-join-4.6.1.jar --jar lucene-java-4.6.1/lucene/build/facet/lucene-facet-4.6.1.jar --jar lucene-java-4.6.1/lucene/build/suggest/lucene-suggest-4.6.1.jar --jar lucene-java-4.6.1/lucene/build/expressions/lucene-expressions-4.6.1.jar --use_full_names --include lucene-java-4.6.1/lucene/build/misc/lucene-misc-4.6.1.jar --include lucene-java-4.6.1/lucene/expressions/lib/antlr-runtime-3.5.jar --include lucene-java-4.6.1/lucene/expressions/lib/asm-4.1.jar --include lucene-java-4.6.1/lucene/expressions/lib/asm-commons-4.1.jar --package java.lang java.lang.system java.lang.runtime --package java.util java.util.arrays java.util.collections java.util.hashmap java.util.hashset java.util.treeset java.lang.illegalstateexception java.lang.indexoutofboundsexception java.util.nosuchelementexception java.text.simpledateformat java.text.decimalformat java.text.collator --package java.util.concurrent java.util.concurrent.executors --package java.util.regex --package java.io java.io.stringreader java.io.inputstreamreader java.io.fileinputstream java.io.datainputstream --exclude org.apache.lucene.sandbox.queries.regex.jakartaregexpcapabilities --exclude org.apache.regexp.regexptunnel --python lucene --mapping org.apache.lucene.document.document 'get:(ljava/lang/string;)ljava/lang/string;' --mapping java.util.properties 'getproperty:(ljava/lang/string;)ljava/lang/string;' --sequence java.util.abstractlist 'size:()i' 'get:(i)ljava/lang/object;' org.apache.lucene.index.indexwriter:getreader --version 4.6.1 --module python/collections.py --module python/icunormalizer2filter.py --module python/icufoldingfilter.py --module python/icutransformfilter.py --resources lucene-java-4.6.1/lucene/analysis/icu/src/resources --files 8 --build warning: renaming static method 'tostring' on class java.lang.boolean 'tostring_' since shadowed non-static method of same name. warning: renaming static method 'tostring' on class java.lang.character 'tostring_' since shadowed non-static method of same name. exception in thread "main" java.lang.nosuchmethodexception: org.apache.lucene.analysis.tokenizer.pythondecref() @ java.lang.class.getmethod(class.java:1665) traceback (most recent phone call last): file "/usr/lib/python2.7/runpy.py", line 162, in _run_module_as_main "__main__", fname, loader, pkg_name) file "/usr/lib/python2.7/runpy.py", line 72, in _run_code exec code in run_globals file "/usr/local/lib/python2.7/dist-packages/jcc-2.19-py2.7-linux-x86_64.egg/jcc/__main__.py", line 107, in <module> cpp.jcc(sys.argv) file "/usr/local/lib/python2.7/dist-packages/jcc-2.19-py2.7-linux-x86_64.egg/jcc/cpp.py", line 687, in jcc declares, typeset) file "/usr/local/lib/python2.7/dist-packages/jcc-2.19-py2.7-linux-x86_64.egg/jcc/cpp.py", line 1174, in code supermethod = find_method(supercls, methodname, params) file "/usr/local/lib/python2.7/dist-packages/jcc-2.19-py2.7-linux-x86_64.egg/jcc/cpp.py", line 310, in find_method if (e.getjavaexception().getclass().getname() == 'java.lang.nosuchmethodexception'): file "/usr/local/lib/python2.7/dist-packages/jcc-2.19-py2.7-linux-x86_64.egg/jcc/cpp.py", line 51, in getjavaexception homecoming self.args[0] indexerror: tuple index out of range make: *** [compile] error 1

on searching error few old mailing list found had similar errors not able hint out.

can please allow me know went wrong , how prepare it?

do need install java lucene before installing pylucene?

following these instructions (http://bendemott.blogspot.de/2013/11/installing-pylucene-4-451.html) got scheme installed pylucene. before working, crazy , had problem (building pylucene on ubuntu 14.04(trusty tahr)) after thorough reformatting , fresh ubuntu 14.04 got running:

# downloads , extract pylucene $ wget http://mirror.serversupportforum.de/apache/lucene/pylucene/pylucene-4.9.0-0-src.tar.gz $ tar -zxvf pylucene-4.9.0-0-src.tar.gz # install dependencies $ sudo apt-get install ant $ sudo apt-get install g++ $ sudo apt-get install python-dev $ sudo apt-get install python3-setuptools $ sudo easy_install pip $ sudo pip install setuptools --upgrade # build , install pylucene $ cd pylucene-4.9.0-0/jcc $ sudo python setup.py build $ sudo python setup.py install $ cd ..

edit file named "makefile" located @ root of pylucene-4.9.0 directory extracted , locate line:

# linux (ubuntu 11.10 64-bit, python 2.7.2, openjdk 1.7, setuptools 0.6.16)

uncomment lines in makefile shown (if on linux) , save changes:

then go on with:

$ create $ sudo create install

voila, it's installed. test pylucene works:

$ python >>> import lucene >>> lucene.initvm()

python ubuntu lucene ubuntu-14.04 pylucene

No comments:

Post a Comment