Dear All, I got this error when trying to import pylucene inside Postgres PL/Python.
ERROR: ('Traceback (most recent call last): File "<string>", line 17, in __plpython_procedure_testing_1517611 File "d:\\ve\\Lib\\site-packages\\lucene-3.4.0-py2.6-win32.egg\\lucene\\__init__.py", line 5, in <module> import jcc, _lucene File "d:\\ve\\Lib\\site-packages\\jcc-2.11-py2.6-win32.egg\\jcc\\__init__.py", line 34, in <module> from _jcc import initVM ImportError: DLL load failed: The specified module could not be found. ',) 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 python interpretor, outside Postgres. How to solve this? Here's my code: drop function testing(); CREATE FUNCTION testing() RETURNS text AS $$ import os import ctypes ctypes.windll.LoadLibrary("jvm") plpy.info(os.environ['Path']) try: import lucene except Exception, e: import traceback plpy.error(traceback.format_exc()) else: return "" $$ LANGUAGE plpythonu;