Pylucene 4.9.0 Ubuntu 14.04 Installation ImportErr

2019-09-03 08:24发布

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条回答
Emotional °昔
2楼-- · 2019-09-03 08:48

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.

查看更多
登录 后发表回答