Error importing Zookeeper libzookeeper_mt.so.2 in python

天大地大妈咪最大 提交于 2020-01-05 04:26:25

问题


I am having issues trying to import this .so file in Python...I added this to my /etc/bashrc and source'd it to make it reload...no luck so far...

LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib

The file DOES exist at /usr/local/lib/lobzookeeper_mt.so.2

  File "build/bdist.linux-x86_64/egg/zookeeper.py", line 7, in <module>
  File "build/bdist.linux-x86_64/egg/zookeeper.py", line 6, in __bootstrap__
ImportError: libzookeeper_mt.so.2: cannot open shared object file: No such file or directory

I have no idea what to do at this point, anyone have an idea on what I am doing wrong? I am using Centos 6 64 bit too btw.


回答1:


Attempting to load a library will, confusingly, fail with "no such file or directory" if a dependency of the library you're trying to load cannot be found. Run ldd:

ldd /path/to/your/library.so

and look for the words "not found" to check if this is the case.




回答2:


export LD_LIBRARY_PATH=/usr/local/lib may solve your problem




回答3:


  1. temporary way:export LD_LIBRARY_PATH=/usr/local/lib
  2. permanent way:edit /root/.bashrc, add following lines:
    • export LD_LIBRARY_PATH=/usr/local/lib


来源:https://stackoverflow.com/questions/15536171/error-importing-zookeeper-libzookeeper-mt-so-2-in-python

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