I have no isue importing jvm.dll using ctypes, ctypes.windll.LoadLibrary("jvm")The path to jvm.dll is also listed on the PATH environment variable,from the output of the statement plpy.info(os.environ['Path']) below.I have no problem importing pylucene on my system's pythoninterpretor, outside Postgres.

Search Discussions

Andi VajdaYou probably need to set some PATH environment variable to contain the directory that contains the _jcc.dll for the process Postgres is running in. A Postgres windows user mailing list may have more details for you. Don't forget that you also must run initVM() from the process' main thread and that each thread calling into PyLucene must call attachCurrentThread() too. Last but not least, is the version of Python embedded in Postgres the same as the one you used to build PyLucene ? Andi..

I have no isue importing jvm.dll using ctypes, ctypes.windll.LoadLibrary("jvm")The path to jvm.dll is also listed on the PATH environment variable,from the output of the statement plpy.info(os.environ['Path']) below.I have no problem importing pylucene on my system's pythoninterpretor, outside Postgres.

How to solve this?

You probably need to set some PATH environment variable to contain the directory that contains the _jcc.dll for the process Postgres is running in.A Postgres windows user mailing list may have more details for you.Don't forget that you also must run initVM() from the process' main thread and that each thread calling into PyLucene must call attachCurrentThread() too.

Last but not least, is the version of Python embedded in Postgres the same as the one you used to build PyLucene ?

Jiang Fung WongI have added the directory containing jcc.dll, which is the jcc egg, to PATH. It is not necessary, because the code in jcc\__init__.py automatically adds the directory to PATH. Anyway I have added it, and the result is the same. I couldn't not import lucene module, so there is way to run initVM(). I can run pyLucene in Python 2.6.4, and the postgres' python is also 2.6.4

I have added the directory containing jcc.dll, which is the jcc egg,to PATH. It is not necessary, because the code in jcc\__init__.pyautomatically adds the directory to PATH. Anyway I have added it, andthe result is the same.

I couldn't not import lucene module, so there is way to run initVM().

I can run pyLucene in Python 2.6.4, and the postgres' python is also 2.6.4

On Tue, Nov 8, 2011 at 2:57 PM, Andi Vajda wrote:

On Nov 7, 2011, at 22:28, Jiang Fung Wong wrote:

Dear All,

I got this error when trying to import pylucene inside Postgres PL/Python.

I have no isue importing jvm.dll using ctypes, ctypes.windll.LoadLibrary("jvm")The path to jvm.dll is also listed on the PATH environment variable,from the output of the statement plpy.info(os.environ['Path']) below.I have no problem importing pylucene on my system's pythoninterpretor, outside Postgres.

How to solve this?

You probably need to set some PATH environment variable to contain the directory that contains the _jcc.dll for the process Postgres is running in.A Postgres windows user mailing list may have more details for you.Don't forget that you also must run initVM() from the process' main thread and that each thread calling into PyLucene must call attachCurrentThread() too.

Last but not least, is the version of Python embedded in Postgres the same as the one you used to build PyLucene ?

Andi VajdaThen it could be that a DLL that _jcc.dll depends on was not found or could not otherwise be loaded. Is there a Java VM embedded in the Postgres process ? If so, is it the same that was used to build PyLucene ? Andi..

I have added the directory containing jcc.dll, which is the jcc egg,to PATH. It is not necessary, because the code in jcc\__init__.pyautomatically adds the directory to PATH. Anyway I have added it, andthe result is the same.

Then it could be that a DLL that _jcc.dll depends on was not found or could not otherwise be loaded.

Is there a Java VM embedded in the Postgres process ? If so, is it the same that was used to build PyLucene ?

Andi..

I couldn't not import lucene module, so there is way to run initVM().

I can run pyLucene in Python 2.6.4, and the postgres' python is also 2.6.4

On Tue, Nov 8, 2011 at 2:57 PM, Andi Vajda wrote:

On Nov 7, 2011, at 22:28, Jiang Fung Wong wrote:

Dear All,

I got this error when trying to import pylucene inside Postgres PL/Python.

I have no isue importing jvm.dll using ctypes, ctypes.windll.LoadLibrary("jvm")The path to jvm.dll is also listed on the PATH environment variable,from the output of the statement plpy.info(os.environ['Path']) below.I have no problem importing pylucene on my system's pythoninterpretor, outside Postgres.

How to solve this?

You probably need to set some PATH environment variable to contain the directory that contains the _jcc.dll for the process Postgres is running in.A Postgres windows user mailing list may have more details for you.Don't forget that you also must run initVM() from the process' main thread and that each thread calling into PyLucene must call attachCurrentThread() too.

Last but not least, is the version of Python embedded in Postgres the same as the one you used to build PyLucene ?

Jiang Fung WongI don't see how it turns out this way. Because I am able to use pyLucene on the python interpretor outside postgres. Theoretically they share the same system PATH environment variable, so both of them should import without problem, or both of them have the same problem. Is there a way I can do some debugging? There is no JavaVM embedded in postgres. -JF

I have added the directory containing jcc.dll, which is the jcc egg,to PATH. It is not necessary, because the code in jcc\__init__.pyautomatically adds the directory to PATH. Anyway I have added it, andthe result is the same.

Then it could be that a DLL that _jcc.dll depends on was not found or could not otherwise be loaded.

Is there a Java VM embedded in the Postgres process ? If so, is it the same that was used to build PyLucene ?

Andi..

I don't see how it turns out this way. Because I am able to usepyLucene on the python interpretor outside postgres.Theoretically they share the same system PATH environment variable, soboth of them should import without problem, or both of them have thesame problem. Is there a way I can do some debugging?

There is no JavaVM embedded in postgres.

-JF

I couldn't not import lucene module, so there is way to run initVM().

I can run pyLucene in Python 2.6.4, and the postgres' python is also 2.6.4

On Tue, Nov 8, 2011 at 2:57 PM, Andi Vajda wrote:

On Nov 7, 2011, at 22:28, Jiang Fung Wong wrote:

Dear All,

I got this error when trying to import pylucene inside Postgres PL/Python.

I have no isue importing jvm.dll using ctypes, ctypes.windll.LoadLibrary("jvm")The path to jvm.dll is also listed on the PATH environment variable,from the output of the statement plpy.info(os.environ['Path']) below.I have no problem importing pylucene on my system's pythoninterpretor, outside Postgres.

How to solve this?

You probably need to set some PATH environment variable to contain the directory that contains the _jcc.dll for the process Postgres is running in.A Postgres windows user mailing list may have more details for you.Don't forget that you also must run initVM() from the process' main thread and that each thread calling into PyLucene must call attachCurrentThread() too.

Last but not least, is the version of Python embedded in Postgres the same as the one you used to build PyLucene ?

It has something to do with Postgres. I am asking them on their IRC channel.

On Tue, Nov 8, 2011 at 5:05 PM, Jiang Fung Wongwrote:

On Tue, Nov 8, 2011 at 4:20 PM, Andi Vajda wrote:

On Nov 8, 2011, at 0:08, Jiang Fung Wong wrote:

I have added the directory containing jcc.dll, which is the jcc egg,to PATH. It is not necessary, because the code in jcc\__init__.pyautomatically adds the directory to PATH. Anyway I have added it, andthe result is the same.

Then it could be that a DLL that _jcc.dll depends on was not found or could not otherwise be loaded.

Is there a Java VM embedded in the Postgres process ? If so, is it the same that was used to build PyLucene ?

Andi..

I don't see how it turns out this way. Because I am able to usepyLucene on the python interpretor outside postgres.Theoretically they share the same system PATH environment variable, soboth of them should import without problem, or both of them have thesame problem. Is there a way I can do some debugging?

There is no JavaVM embedded in postgres.

-JF

I couldn't not import lucene module, so there is way to run initVM().

I can run pyLucene in Python 2.6.4, and the postgres' python is also 2.6.4

On Tue, Nov 8, 2011 at 2:57 PM, Andi Vajda wrote:

On Nov 7, 2011, at 22:28, Jiang Fung Wong wrote:

Dear All,

I got this error when trying to import pylucene inside Postgres PL/Python.

I have no isue importing jvm.dll using ctypes, ctypes.windll.LoadLibrary("jvm")The path to jvm.dll is also listed on the PATH environment variable,from the output of the statement plpy.info(os.environ['Path']) below.I have no problem importing pylucene on my system's pythoninterpretor, outside Postgres.

How to solve this?

You probably need to set some PATH environment variable to contain the directory that contains the _jcc.dll for the process Postgres is running in.A Postgres windows user mailing list may have more details for you.Don't forget that you also must run initVM() from the process' main thread and that each thread calling into PyLucene must call attachCurrentThread() too.

Last but not least, is the version of Python embedded in Postgres the same as the one you used to build PyLucene ?