我无法在OSX 10.8上导入h5py。我的libhdf5.7.dylib
中没有/usr/local/lib
。
>>> import h5py
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/sudou/.pyenv/versions/anaconda-2.0.1/lib/python2.7/site-packages/h5py/__init__.py", line 13, in <module>
from . import _errors
ImportError: dlopen(/Users/sudou/.pyenv/versions/anaconda-2.0.1/lib/python2.7/site-packages/h5py/_errors.so, 2): Library not loaded: libhdf5.7.dylib
Referenced from: /Users/sudou/.pyenv/versions/anaconda-2.0.1/lib/python2.7/site-packages/h5py/_errors.so
Reason: image not found
我已经通过自制啤酒安装了hdf5
,可能需要降级hdf5
。但是,我找不到方法。
% ls /usr/local/lib/libhdf*
/usr/local/lib/libhdf5.9.dylib /usr/local/lib/libhdf5.settings /usr/local/lib/libhdf5_hl.dylib
/usr/local/lib/libhdf5.a /usr/local/lib/libhdf5_hl.9.dylib
/usr/local/lib/libhdf5.dylib /usr/local/lib/libhdf5_hl.a
答案 0 :(得分:0)
尝试简单地运行pip install h5py
。
我这样做了,并且能够毫不费力地在翻译中import h5py
。