John Brown
John Brown

Reputation: 63

Error importing JCC. Cannot find libjava.so

I'm having an issue trying to install PyLucene. I'm running the Makefile provided, but am getting an error at line 385:

Traceback (most recent call last):
  File "/home/89772/anaconda3/lib/python3.7/runpy.py", line 183, in _run_module_as_main
    mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
  File "/home/89772/anaconda3/lib/python3.7/runpy.py", line 142, in _get_module_details
    return _get_module_details(pkg_main_name, error)
  File "/home/89772/anaconda3/lib/python3.7/runpy.py", line 109, in _get_module_details
    __import__(pkg_name)
  File "/home/89772/anaconda3/lib/python3.7/site-packages/JCC-3.6-py3.7-linux-x86_64.egg/jcc/__init__.py", line 33, in <module>
    import jcc._jcc3 as _jcc3
ImportError: libjava.so: cannot open shared object file: No such file or directory

The line in the makefile causing the error is python -m jcc with a lot of .jar files as options. I also ran it without any of the options, and get the same error.

I believe I correctly built jcc, however I did do python setup.py install without sudo when building jcc, as I don't have sudo privileges on the machine I was using. Not sure if that is the cause of this issue.

Finally, there was some issues with linking libjava.so and libjvm.so when building jcc, because the machine I'm using does not have the jvm in a subfolder of the jdk folder, and that is where the python script (setup.py) looks for library files by default. I was able to get around this by altering the -L flags in setup.py. I thought, that a similar issue was occurring, but after checking the config.py file in site-packages/JCC.../jcc, it seems that the flags are correct.

Not really sure, where to go from here. Any help would be appreciated. I'm trying to install this on a ubuntu 18.04 with java 11 and python 3.7.4

Upvotes: 1

Views: 339

Answers (0)

Related Questions