Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HDF Error on file write when NetCDF is installed with pip install #962

Open
fmaussion opened this issue Aug 12, 2019 · 4 comments
Open

HDF Error on file write when NetCDF is installed with pip install #962

fmaussion opened this issue Aug 12, 2019 · 4 comments

Comments

@fmaussion
Copy link

Note sure if this of interest to you, or if this is a problem inherent to pip wheels, but: I can't get NetCDF4 to work with pip install on a Debian machine. Writing data to a file exits with an HDF Error:

~/checkouts/readthedocs.org/user_builds/oggmcontrib/envs/latest/lib/python3.7/site-packages/oggm/utils/_workflow.py in create_gridded_ncdf_file(self, fname)
   1971         v.long_name = 'x coordinate of projection'
   1972         v.standard_name = 'projection_x_coordinate'
-> 1973         v[:] = x
   1974 
   1975         v = nc.createVariable('y', 'f4', ('y',), zlib=True)

netCDF4/_netCDF4.pyx in netCDF4._netCDF4.Variable.__setitem__()
netCDF4/_netCDF4.pyx in netCDF4._netCDF4.Variable._put()
netCDF4/_netCDF4.pyx in netCDF4._netCDF4._ensure_nc_success()
RuntimeError: NetCDF: HDF error

As a testbed to test several configurations, I used our ReadTheDocs builds. See e.g. one that fails: https://readthedocs.org/projects/oggmcontrib/builds/9502693/.

After several trial and error, I found a config that worked: pinning python to 3.5 and NetCDF4 to 1.3.1. Both on ReadTheDocs and on my local machine (relatively old Linux Mint with python 3.5), any other combination of higher python or NetCDF versions fail with the error above.

@matteobachetti
Copy link

I have a similar problem. Recent versions of Netcdf-4 crash with HDF Error in my code (e.g. StingraySoftware/HENDRICS#72)

@dopplershift
Copy link
Member

What version of libnetcdf (netcdf-c) is installed on the Debian machine?

@rmvanhees
Copy link

I have the same problem. My system is Debian Stretch with python v3.8.1, hdf5 v1.10.6 and netCDF-c v4.7.3. The problem is solved when I install netCDF4-python from source (obtained with git clone) using "python3 setup.py install". The version of the software is 1.5.4

It is not clear to me if the problem is fixed because I have installed the module from source (instead of pip) or if you have fixed the problem in the source-code? If the latter is case than please can you release version 1.5.4?

@muyuuuu
Copy link

muyuuuu commented Mar 13, 2021

NetCDF4 to 1.3.1.

I met the same error as @fmaussion described. When I runned pip install netCDF4==1.3.1, there was some bug : ValueError: did not find HDF5 headers,how to fix it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants