2012-12-31 131 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

相關問題