问题
I've been trying to install Pylucene on my Mac for a little over a week, and have given up on that in favor of trying to install it with Ubuntu through a virtual machine. I thought the installation process had gone well, so I fired up Python in the terminal and tried to import lucene
and received the following ImportError
:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/parallels/anaconda/lib/python2.7/site-packages/lucene/__init__.py", line 7, in <module>
import _lucene
ImportError: libverify.so: cannot open shared object file: No such file or directory
So, it looks like there is a module _lucene
that does not exist. But I thought this would have been part of what I had just installed? Any insight here would be appreciated.
回答1:
I had to add extra paths to my LD_LIBRARY_PATH
environment variable to get things working. The test here in the conda build script actually shows those variables.
export LD_LIBRARY_PATH=$PREFIX/lib:$PREFIX/jre/lib:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=$PREFIX/jre/lib/amd64:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=$PREFIX/jre/lib/amd64/server:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=$PREFIX/lib/python2.7/site-packages:$LD_LIBRARY_PATH
$PREFIX
here is the path to the anaconda folder. I currently install miniconda at /usr/conda
on my systems.
来源:https://stackoverflow.com/questions/30944637/pylucene-4-9-0-ubuntu-14-04-installation-importerror