Skip to content

PyLucene installation guide

greedo edited this page Dec 13, 2014 · 1 revision

These are steps you will need to run in order:

  1. pushd jcc

  2. Configure setup.py to match your machine's configuration.

  3. python setup.py build

  4. sudo python setup.py install

  5. popd

  6. Now you will need to configure the Makefile to match your environment. I will show you mine as a reference. There are several commented sections based on different environment. Since un-comment the one matching you configuration.

    For example: I am running Ubuntu 14.04, Python 2.7.6, Oracle Java 7, setuptools 0.7

    So mine looks like:

    PREFIX_PYTHON=/usr
    ANT=JAVA_HOME=/usr/lib/jvm/java-7-oracle /usr/bin/ant
    PYTHON=$(PREFIX_PYTHON)/bin/python
    JCC=$(PYTHON) -m jcc --shared
    NUM_FILES=8
    

    It is very important that jcc is compiled with the --shared flag to allow JCC and Python to share memory space for variables.

    Just as a sanity check make sure the top information is correct for version and locations:

    VERSION=4.3.0-0
    LUCENE_SVN_VER=HEAD
    LUCENE_VER=4.3.0
    LUCENE_SVN=http://svn.apache.org/repos/asf/lucene/dev/tags/lucene_solr_4_3_0
    PYLUCENE:=$(shell pwd)
    LUCENE_SRC=lucene-java-$(LUCENE_VER)
    LUCENE=$(LUCENE_SRC)/lucene
    
  7. make

  8. sudo make install

  9. make test (This is not required but highly recommended)

The make process may take a while, so do not exit until it has completed it's work. This is very normal. You should now have a working copy of PyLucene install, basic tutorials all also included with the install.

Currently OpenJDK 1.7 is having problems with PyLucene so use Oracle Java 7. This code is tested for PyLucene 4.3.


If you still have questions you can check: http://lucene.apache.org/pylucene/documentation/install.html

Clone this wiki locally