Pylucene 4.9.0 Ubuntu 14.04 Installation ImportError

扶醉桌前 提交于 2019-12-13 07:25:09

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!