geoslegend / netcdf4-python

Automatically exported from code.google.com/p/netcdf4-python
Other
0 stars 0 forks source link

RuntimeError for new file or in write mode #153

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Installed python-2.7.3
2. Installed numpy-1.6.2
3. Installed netCDF4-1.0.2.win32-py2.7
4. from netCDF4 import Dataset
5. rootgrp = Dataset('test.nc', 'w', format='NETCDF4')

What is the expected output? What do you see instead?

Want to create a new nc file, but see following errors:
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "netCDF4.pyx", line 1375, in netCDF4.Dataset.__init__ (netCDF4.c:16560)
RuntimeError: NetCDF: Can't add HDF5 file metadata

What version of the product are you using? On what operating system?
netCDF4-1.0.2.win32-py2.7 on win7

Please provide any additional information below.

I didn't install HDF5 and netCDF4 C-library. I only installed python-2.7.3, 
numpy-1.6.2, and netCDF4-1.0.2.win32-py2.7.exe. If I install HDF5 and netCDF4 
C-library, how can I link these C-library to netCDF4-1.0.2.win32-py2.7?

For an existing nc file 'test2.nc', open it in read-only mode is fine:
rootgrp = Dataset('test2.nc', 'r', format='NETCDF4')

But I cannot open it in 'w', 'r+', or 'a'. Will see:
RuntimeError: NetCDF: HDF error

Thanks for help.

Original issue reported on code.google.com by czhang2...@gmail.com on 17 Dec 2012 at 10:43

GoogleCodeExporter commented 8 years ago
Could it be a filesystem permission issue?  Do you have write permission in the 
directory you are trying to create the file in?

Original comment by whitaker.jeffrey@gmail.com on 18 Dec 2012 at 12:07

GoogleCodeExporter commented 8 years ago
Great answer! I just try it in my home computer, and I can create a new nc file 
without any problems. Must be the write permission issue in my office computer.

I really appreciate your help. 

Original comment by czhang2...@gmail.com on 18 Dec 2012 at 12:56

GoogleCodeExporter commented 8 years ago

Original comment by whitaker.jeffrey@gmail.com on 7 Mar 2013 at 11:41