gpt4 book ai didi

python - h5py 安装后报错

转载 作者:太空狗 更新时间:2023-10-30 01:03:16 24 4
gpt4 key购买 nike

<分区>

Possible Duplicate:
Installing h5py on OS X

我正在尝试让 h5py 在我的 OS X Lion 10.7.3 Macbook Pro 上运行。它以前工作过,但不知何故被卸载了,我无法再次安装它。这似乎与安装 XCode 4.3 有关,但我不确定。

导入h5py时出现如下错误:

>>> import h5py


Traceback (most recent call last):

File "<stdin>", line 1, in <module>
File "/Library/Python/2.7/site-packages/h5py/__init__.py", line 1, in <module>
from h5py import _errors
ImportError: dlopen(/Library/Python/2.7/site-packages/h5py/_errors.so, 2): Symbol not found: _H5E_ALREADYEXISTS_g
Referenced from: /Library/Python/2.7/site-packages/h5py/_errors.so
Expected in: flat namespace
in /Library/Python/2.7/site-packages/h5py/_errors.so

我想这与 HDF5 库有关。它还没有安装,所以我先安装它使用

brew install hdf5

这没有错误。但最后有以下警告。我想这很重要:

ld: warning: ignoring file ../hdf5-1.8.8/hdf5/lib/libhdf5.a, 
file was built for archive which is not the architecture being linked (i386)

我不是 100% 确定这意味着什么,但我猜这个库是为 i386 架构编译的,但是这个目录中有更多文件它不会提示:

libhdf5.la
libhdf5.dylib -> libhdf5.7.dylib
libhdf5.7.dylib
libhdf5.settings
libhdf5.a
libhdf5_hl.la
libhdf5_hl.dylib -> libhdf5_hl.7.dylib
libhdf5_hl.a
libhdf5_hl.7.dylib

后来我也自己编译了源码,从 HDF5 group-website ( http://www.hdfgroup.org/HDF5/ ) 下载。使用以下配置行,以确保它生成我添加的共享库 --enable-shared 和 disabled fortran:

./configure --with-zlib=/usr/local --disable-fortran 
--prefix=/usr/local/ --target=x86_64-apple-darwin
-build=x86_64-apple-darwin --host=x86_64-apple-darwin
--enable-shared --disable-production

我已经删除了 h5py 和 hdf5 库并重新安装了几次(都是自己编译 h5py,使用 pip 和 easy_install),但这似乎没有帮助。

我还使用我刚刚使用此命令构建的版本安装了 h5py:

python setup.py build --hdf5=../hdf5-1.8.8/hdf5

我还将我的 numpy 和 scipy 安装更新到最新版本。

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com