2012-12-31 126 views
4

我想运行一个python脚本依赖于其他模块,但是我碰到了这一点:导入错误:无法在Python打开共享对象文件

bash-3.2$ PYTHONPATH=/my/path/tables-2.3.1/build/lib.linux-x86_64-2.7/ ./fastcluster.py 
Traceback (most recent call last): 
    File "./fastcluster.py", line 5, in <module> 
    import tables 
    File "/my/path/tables-2.3.1/build/lib.linux-x86_64-2.7/tables/__init__.py", line 59, in <module> 
    from tables.utilsExtension import getPyTablesVersion, getHDF5Version 
ImportError: libhdf5.so.7: cannot open shared object file: No such file or directory 
bash-3.2$ ls libhdf5.so.7 
libhdf5.so.7 
bash-3.2$ 

没有这样的文件或目录libhdf5.so.7?但是当我知道它时,它就在我的目录中。那么这里发生了什么?

+1

检查顶部的答案在这里:http://stackoverflow.com/questions/1099981/why-cant-python-find-shared-objects-that-are-in-directories-in-sys-path ?answertab=票#tab-top它可以满足你的需求 –

回答

6

装载机不在那里。将它放在库的标准位置之一,将目录添加到加载程序配置中,或在运行Python之前设置$LD_LIBRARY_PATH

相关问题