2

I programme in python and I use a OS X Yosemite version 10.10.2. I have installed h5py 2.5.0-1 in enthought canopy using its package manager. So, h5py 2.5.0-1 has appeared in my installed packages in canopy with a little green tick besides it.

However, when I test it, using the code below or any other code related to h5py, it gives me an error:

This is my test code:

import h5py
import numpy as np
f = h5py.File('test.hdf5', 'w')

This is the error:

1 import h5py
2 import numpy as np
----> 3 f = h5py.File('test.hdf5', 'w')
4 
5

AttributeError: 'module' object has no attribute 'File'

As an additional information, my numpy package works properly.Could anybody help me with that please? Thank you very much in advance!

ρss
  • 5,115
  • 8
  • 43
  • 73
Danielle
  • 21
  • 2
  • 3
    It is possible that you have another `h5py.py` module that is getting imported instead of the installed `h5py` package. Check what file is actually getting imported by `print h5py.__file__`. It should be something like `.../site-packages/h5py/__init__.pyc` – Robert Kern Apr 29 '15 at 13:23

0 Answers0