导入ghmm库出错
我收到此错误:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.6/dist-packages/ghmm.py", line 112, in <module>
import ghmmwrapper
File "/usr/local/lib/python2.6/dist-packages/ghmmwrapper.py", line 25, in <module>
_ghmmwrapper = swig_import_helper()
File "/usr/local/lib/python2.6/dist-packages/ghmmwrapper.py", line 21, in swig_import_helper
_mod = imp.load_module('_ghmmwrapper', fp, pathname, description)
ImportError: libghmm.so.1: cannot open shared object file: No such file or directory
但是
root@ubuntu:~# sudo locate libghmm
/usr/local/lib/libghmm.a
/usr/local/lib/libghmm.la
/usr/local/lib/libghmm.so
/usr/local/lib/libghmm.so.1
/usr/local/lib/libghmm.so.1.0.0
为什么我收到此错误?我尝试添加
/usr/local/lib/
到我的 PYTHONPATH
但它不起作用。
i get this error:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.6/dist-packages/ghmm.py", line 112, in <module>
import ghmmwrapper
File "/usr/local/lib/python2.6/dist-packages/ghmmwrapper.py", line 25, in <module>
_ghmmwrapper = swig_import_helper()
File "/usr/local/lib/python2.6/dist-packages/ghmmwrapper.py", line 21, in swig_import_helper
_mod = imp.load_module('_ghmmwrapper', fp, pathname, description)
ImportError: libghmm.so.1: cannot open shared object file: No such file or directory
but
root@ubuntu:~# sudo locate libghmm
/usr/local/lib/libghmm.a
/usr/local/lib/libghmm.la
/usr/local/lib/libghmm.so
/usr/local/lib/libghmm.so.1
/usr/local/lib/libghmm.so.1.0.0
Why go i get this error? i tried adding
/usr/local/lib/
to my PYTHONPATH
but it didn't work.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
PYTHONPATH
适用于 python 模块,不适用于系统库。您可以将本地路径添加到系统:
/etc/ld.so.conf
/usr/local/lib
然后重新启动您的应用程序,它就会工作。
如果您不想对系统进行任何更改,可以使用环境变量:
PYTHONPATH
is working for python modules, not for system libraries.You can add the local path to your system:
/etc/ld.so.conf
/usr/local/lib
Then restart your application, it will work.
If you don't want to change anything to your system, you can use the environment variable:
尝试仅执行 sudo ldconfig 来进行运行时绑定。
Try to just execute sudo ldconfig for run-time bindings.