Opened 8 years ago
Closed 8 years ago
#51923 closed defect (fixed)
Pytables fails to create hdf5 table
Reported by: | dershow | Owned by: | mamoll (Mark Moll) |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | ports | Version: | 2.3.4 |
Keywords: | Cc: | ||
Port: | py-tables |
Description
I first tried to create an hdf5 table using pandas. But, that failed. So, I went to pytables instead, and that also fails with a similar error. I'm using py27-tables @3.2.2_2 which is using hdf5 @1.10.0_1 Here is a simple example, grabbed from the pytables web page
>>> import tables >>> from tables import * >>> h5file = open_file("tutorial1.h5", mode = "w", title = "Test file") >>> group = h5file.create_group("/", 'detector', 'Detector information') >>> class Particle(IsDescription): ... name = StringCol(16) ... idnumber = Int64Col() # ... ADCcount = UInt16Col() # Unsigned ... >>> table = h5file.create_table(group, 'readout', Particle, "Readout example") Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/tables/file.py", line 1060, in create_table chunkshape=chunkshape, byteorder=byteorder) File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/tables/table.py", line 873, in __init__ byteorder, _log) File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/tables/leaf.py", line 262, in __init__ super(Leaf, self).__init__(parentnode, name, _log) File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/tables/node.py", line 270, in __init__ self._v_objectid = self._g_create() File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/tables/table.py", line 1066, in _g_create self._v_new_title, self.filters.complib or '', obversion) File "tables/tableextension.pyx", line 222, in tables.tableextension.Table._create_table (tables/tableextension.c:3322) tables.exceptions.HDF5ExtError: HDF5 error back trace File "H5A.c", line 265, in H5Acreate2 not a location File "H5Gloc.c", line 253, in H5G_loc invalid object ID End of HDF5 error back trace Can't set attribute 'CLASS' in table: readout.
Attachments (1)
Change History (10)
comment:1 Changed 8 years ago by dershow
Changed 8 years ago by mamoll (Mark Moll)
comment:4 Changed 8 years ago by mamoll (Mark Moll)
py-tables apparently doesn't work with hdf5 1.10. I have attached a patched Portfile. It requires hdf5 to be deactivated during the build, which seems a little kludgey. Can anyone think of a better solution?
comment:5 Changed 8 years ago by dershow
There is a separate port from hdf5, called hdf5-18 @1.8.16_5. I have that installed as well as hdf5. Apparently, it was installed by netcdf. Perhaps it is possible to either use that port for py-tables, or to use whatever technique was used to build that, as it seems to work?
comment:6 Changed 8 years ago by mamoll (Mark Moll)
Yes, the patched Portfile requires hdf5-18. The issue is that at build time, hdf5 needs to be deactivated. It'd be nice it this was not necessary.
comment:7 Changed 8 years ago by mf2k (Frank Schima)
Cc: | mmoll@… removed |
---|---|
Owner: | changed from macports-tickets@… to mmoll@… |
Port: | py-tables added; py27-tables removed |
comment:8 Changed 8 years ago by dershow
I tried to deactivate and then used the attached file and it does work for me.
comment:9 Changed 8 years ago by mamoll (Mark Moll)
Resolution: | → fixed |
---|---|
Status: | new → closed |
Fixed in r150948.
It looks like this #51923 is probably the same problem, although that bug is written for py27-pyne.