netcdf4-python icon indicating copy to clipboard operation
netcdf4-python copied to clipboard

Unable to read OpenDAP with 1.6.4, manual creation of ~/.esg required

Open BSchilperoort opened this issue 2 years ago • 3 comments

System info:

  • OS: Linux Mint
  • Python version: 3.10
  • python-netCDF4 version: 1.6.4

When trying to read an OpenDAP url with netCDF4==1.6.4, I get the following error:

Cookie file cannot be read and written: /home/username/.esg/.dods_cookies
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "src/netCDF4/_netCDF4.pyx", line 2464, in netCDF4._netCDF4.Dataset.__init__
  File "src/netCDF4/_netCDF4.pyx", line 2027, in netCDF4._netCDF4._ensure_nc_success
OSError: [Errno -37] NetCDF: Write to read only: 'http://iridl.ldeo.columbia.edu/SOURCES/.OSU/.PRISM/.monthly/dods'

It works fine in 1.6.2.

However, when creating the folder ~/.esg, the OpenDAP dataset loaded in fine. in 1.6.4.

Used code:

import netCDF4
dataset = netCDF4.Dataset("http://iridl.ldeo.columbia.edu/SOURCES/.OSU/.PRISM/.monthly/dods")

BSchilperoort avatar Oct 04 '23 11:10 BSchilperoort

did you install both 1.6.2 and 1.6.4 via pip (using binary wheels)?

jswhit avatar Oct 04 '23 14:10 jswhit

Yes, they were both installed using pip, which grabbed the binary wheels.

BSchilperoort avatar Oct 05 '23 08:10 BSchilperoort

it's an issue with netcdf-c 4.9.2, which is used in the 1.6.4 wheel.

jswhit avatar Oct 09 '23 02:10 jswhit