Discussion:
Pydev and pylucene issues reading libraries
Kevin Lopez
2016-07-12 22:09:44 UTC
Permalink
I have a django project in eclipse's pydev enviroment which need access to
the libjvm.so located at:

/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/server/
File "/home/kevin/git/YIF/imageFinder/tools/indexer.py", line 5, in
<module>
import lucene
File "/usr/lib/python2.7/dist-packages/lucene/__init__.py", line 2, in
<module>
import os, _lucene
ImportError: libjvm.so: cannot open shared object file: No such file or
directory
How can I get pydev/eclipse to see this library? I tried doing:

import lucene
lucene.initVM()

And it seems to work in a python shell running in terminal, but I can't do
this in eclipse, anyone know how I can resolve this? I am running Ubuntu
16.04

Thanks,

Kevin
Andi Vajda
2016-07-12 23:16:23 UTC
Permalink
Post by Kevin Lopez
I have a django project in eclipse's pydev enviroment which need access to
/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/server/
File "/home/kevin/git/YIF/imageFinder/tools/indexer.py", line 5, in
<module>
import lucene
File "/usr/lib/python2.7/dist-packages/lucene/__init__.py", line 2, in
<module>
import os, _lucene
ImportError: libjvm.so: cannot open shared object file: No such file or
directory
import lucene
lucene.initVM()
And it seems to work in a python shell running in terminal, but I can't do
this in eclipse, anyone know how I can resolve this? I am running Ubuntu
16.04
If it works in a shell and the shell finds it with the help of LD_LIBRARY_PATH then you need to make sure eclipse sees the same env variable. If eclipse already loads a libjvm.so file for its own use, you need to ensure it's the same version as the one you're trying to load with PyLucene.
These are just guesses, I don't use eclipse.

Andi..
Post by Kevin Lopez
Thanks,
Kevin
Kevin Lopez
2016-07-14 17:37:48 UTC
Permalink
Andi,

Thanks for the advice! I was able to resolve the issue by removing the
interpreter from the project then adding it again. After I did this I was
able to run the code with no issues.

Regards,

Kevin
Post by Andi Vajda
Post by Kevin Lopez
I have a django project in eclipse's pydev enviroment which need access
to
Post by Kevin Lopez
/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/server/
File "/home/kevin/git/YIF/imageFinder/tools/indexer.py", line 5, in
<module>
import lucene
File "/usr/lib/python2.7/dist-packages/lucene/__init__.py", line 2, in
<module>
import os, _lucene
ImportError: libjvm.so: cannot open shared object file: No such file or
directory
import lucene
lucene.initVM()
And it seems to work in a python shell running in terminal, but I can't
do
Post by Kevin Lopez
this in eclipse, anyone know how I can resolve this? I am running Ubuntu
16.04
If it works in a shell and the shell finds it with the help of
LD_LIBRARY_PATH then you need to make sure eclipse sees the same env
variable. If eclipse already loads a libjvm.so file for its own use, you
need to ensure it's the same version as the one you're trying to load with
PyLucene.
These are just guesses, I don't use eclipse.
Andi..
Post by Kevin Lopez
Thanks,
Kevin
Loading...