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?但是當我知道它時,它就在我的目錄中。那麼這裏發生了什麼?
檢查頂部的答案在這裏:http://stackoverflow.com/questions/1099981/why-cant-python-find-shared-objects-that-are-in-directories-in-sys-path ?answertab=票#tab-top它可以滿足你的需求 –