[pylucene-dev] how to build a PyLucene egg?
Andi Vajda
vajda at osafoundation.org
Tue Mar 4 09:08:54 PST 2008
On Tue, 4 Mar 2008, Bill Janssen wrote:
>> The problem with distributing JCC and PyLucene binaries is that you need to
>> be careful with classpath and shared library path issues.
>> PyLucene's lucene.CLASSPATH variable is set to point to the lucene jar files
>> that it contains as egg resources. The path is absolute but computed at
>> runtime from a relative stub (see lucene....egg/lucene/__init__.py).
>> The shared library path, on the other hand, is baked into the jcc binaries
>> via the rpath link flag. Different installs have java in different locations
>> (albeit, not the case on mac) and the java shared libs might not get found
>> until you workaround the bogus path baked in via LD_LIBRARY_PATH (on Linux)
>> and PATH on Windows (or DYLD_LIBRARY_PATH on Mac, but it's not a problem in
>> Mac since Apple pre-installs java into a known framework location).
>
> Yes, this is an issue. Not on OS X, since it's a predictable
> configuration, or on Linux, since it's so unpredictable that I build
> everything from source on the target machine, but for Windows. On
> Windows, UpLib looks in the registry of the target machine to see
> where Java is, and makes sure to use fully-qualified pathnames to run
> it. So it seems that, on Windows, I'm going to have to set PATH in
> the Python program that uses PyLucene before actually importing
> "lucene", right? Will Python's "os.environ['PATH']" work for this?
I'm not sure you can change the PATH env of a running process. You might
have to do this before starting Python. You can also do it before spawning a
subprocess. Trial and error, I guess :)
Andi..
More information about the pylucene-dev
mailing list