H5py gives an error after installation

Possible duplicate:
Installing h5py on OS X

I am trying to get h5py to work with my X Lion 10.7.3 Macbook Pro OS. It worked before, but somehow it was removed, and I can’t install it again. This seems to be related to installing Xcode 4.3, but I'm not sure.

When importing h5py, the following error occurs:

>>> 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

I think this is due to the HDF5 library. It is not installed yet, so I installed it first with

brew install hdf5

It made no mistakes. But the next warning is at the end. which I think is important:

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)

I am not 100% sure what this means, but I think this library is compiled for the i386 architecture, however there are no more files in this directory in it:

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 (http://www.hdfgroup.org/HDF5/). , , , 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 .

+5
1

Mac OS X Lion :

  • Xcode
  • Homebrew
  • Homebrew, Xcode (xcode-select ...)

:

$ brew install hdf5

, /usr/local/lib . brew doctor, , :

$ brew doctor
Warning: You have unlinked kegs in your Cellar
Leaving kegs unlinked can lead to build-trouble and cause brews that depend on
those kegs to fail to run properly once built.

    hdf5
    szip

,

$ brew link hdf5
$ brew link szip

$ sudo pip install h5py

.

>>> import h5py
>>> 
+6

All Articles