[pylucene-dev] building JCC on Windows with MinGW
Andi Vajda
vajda at osafoundation.org
Wed Mar 19 19:03:24 PDT 2008
On Wed, 19 Mar 2008, Bill Janssen wrote:
>> Now I'm running into trouble loading jcc in python, because it can't
>> find the JVM dll:
>>
>> from _jcc import initVM
>> ImportError: DLL load failed: The specified module could not be found.
>>
>> If I attempt to use jcc to compile Lucene, I get the pop-up box
>> saying, "This application has failed to start because jvm.dll was not
>> found. Re-installing the application may fix this problem."
>
> This is kind of nasty. Turns out I need $JAVAHOME/jre/bin/client on
> my PATH before "import jcc" will work in Python. This is the logical
> equivalent of the LD_LIBRARY_PATH problem on Unix.
Yes, very much so.
> So, we need to figure out how to do this for Windows Python. We really
> want Python (rather, the JCC __init__.py file) to look in the Windows
> registry and do the right thing with what it finds there (basically,
> adding the right location for the jvm.dll to sys.path), before it attempts
> to import either "jcc" or "_jcc".
It's not sys.path (that's where PYTHONPATH ends up), it's the env's PATH or,
more precisely, the process's executable search path that needs to be
updated. I don't know of a linker way to do this on Windows. Once the
process has started, my understanding is that it's too late already.
In Chandler, we have a starter process that starts python after setting the
proper search path.
Andi..
More information about the pylucene-dev
mailing list