You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Additionally, it looks as though this issue only happens when in a pure python environment running netCDF4==1.6.0. My test ensemble based on Anaconda and netCDF4==1.6.0 seems to be opening this OPeNDAP URL perfectly fine!
Update: I think the wheel being supplied via PyPI is broken. After compiling netCDF4==1.6.0 from sources, everything seems to be working perfectly fine. I needed to run the following after other dependencies were installed in my environment.
BTW, the screenshots in #1179 (comment) make it hard to read about the real issue. It seems that the problem is with curl and some SSL certificates. I get this when I try it locally:
Error:curl error: Problem with the SSL CA cert (path? access rights?)
curl error details:
Warning:oc_open: Could not read url
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "src/netCDF4/_netCDF4.pyx", line 2353, in netCDF4._netCDF4.Dataset.__init__
File "src/netCDF4/_netCDF4.pyx", line 1963, in netCDF4._netCDF4._ensure_nc_success
@jswhit what version/build of curl are you using in the wheel?
It may be a version problem or something with the wheel build. I guess the only way to figure this out is to add an OPeNDAP test during the wheel test phase. This is how I reproduced it locally in case you want to check it out:
conda create --name TEST python=3 pip
pip install netcdf4
python -c "import netCDF4; ds = netCDF4.Dataset('http://thredds.socib.es/thredds/dodsC/hf_radar/hf_radar_ibiza-scb_codarssproc001/L1/2016/dep0001_hf-radar-ibiza_scb-codarssproc001_L1_2016-02.nc')"
Error:curl error: Problem with the SSL CA cert (path? access rights?)
curl error details:
Warning:oc_open: Could not read url
Traceback (most recent call last):
File "<string>", line 1, in<module>
File "src/netCDF4/_netCDF4.pyx", line 2353, in netCDF4._netCDF4.Dataset.__init__
File "src/netCDF4/_netCDF4.pyx", line 1963, in netCDF4._netCDF4._ensure_nc_success
OSError: [Errno -68] NetCDF: I/O failure: b'http://thredds.socib.es/thredds/dodsC/hf_radar/hf_radar_ibiza-scb_codarssproc001/L1/2016/dep0001_hf-radar-ibiza_scb-codarssproc001_L1_2016-02.nc'
Then, if I do a conda install netcdf4, the test pass and I have these packages installed:
I was having the same problem. I installed once with "%pip install netcdf4<1.6" and once with "%pip install netcdf4<1.6". I can confirm it works with one, but not the other.
For each, I used ldd to look at the linked libraries. Below are two lists. The first is the full list where I have sorted to align libraries. The second is just the places where version number or library has changed. I'm not sure if this helps, but I am hoping someone who knows more about this would have some thoughts.
@jswhit, I am available to do some digging and try to solve this issue since it is causing a lot of problem for other libraries. Do you have any suggestions to where should I start looking?
I'll check the openssl version used and try to add a regression test in the wheel building process to investigate. I can confirm that this doesn't happen in the Windows wheel and @ngam confirmed it doesn't happen in the M1 wheel. It must be the Linux openssl version then.
In the Aug 8 traceback above (and pasted below), the URL string gets turned into a byte string by netCDF4. Could that be relevant? I had this problem and fixed it by using an older version of netCDF4 that keeps the string as a string. There was a similar issue with strings converted to byte strings 2 years ago: pydata/xarray#4859
Activity
giovaniceotto commentedon Jul 31, 2022
Additional information: When using
"netCDF4<1.6.0", the code runs fine, without any errors.Zeitsperre commentedon Aug 2, 2022
I've run into this issue as well:

Additionally, it looks as though this issue only happens when in a pure python environment running
netCDF4==1.6.0. My test ensemble based on Anaconda andnetCDF4==1.6.0seems to be opening this OPeNDAP URL perfectly fine!Zeitsperre commentedon Aug 4, 2022
Update: I think the wheel being supplied via PyPI is broken. After compiling
netCDF4==1.6.0from sources, everything seems to be working perfectly fine. I needed to run the following after other dependencies were installed in my environment.You may want to consider rebuilding your wheels (for
manylinux*x86_64, anyway).For reference: CSHS-CWRA/RavenPy@5bab92e
jswhit commentedon Aug 5, 2022
What specifically do you think needs to be done differently when building the manylinux wheels?
ocefpaf commentedon Aug 5, 2022
BTW, the screenshots in #1179 (comment) make it hard to read about the real issue. It seems that the problem is with curl and some SSL certificates. I get this when I try it locally:
@jswhit what version/build of curl are you using in the wheel?
jswhit commentedon Aug 6, 2022
curl i s 7.75.0, openssl is 1.0.2u
ocefpaf commentedon Aug 8, 2022
It may be a version problem or something with the wheel build. I guess the only way to figure this out is to add an OPeNDAP test during the wheel test phase. This is how I reproduced it locally in case you want to check it out:
Then, if I do a conda install netcdf4, the test pass and I have these packages installed:
ngam commentedon Aug 17, 2022
@ocefpaf @jswhit any way we could help here? FWIW, this issue is not present on M1 Macs.
ocefpaf commentedon Aug 18, 2022
I believe that the wheel should be rebuilt. One test folks could try is to conda install it on colab and see if that works.
barronh commentedon Sep 19, 2022
I was having the same problem. I installed once with "%pip install netcdf4<1.6" and once with "%pip install netcdf4<1.6". I can confirm it works with one, but not the other.
For each, I used
lddto look at the linked libraries. Below are two lists. The first is the full list where I have sorted to align libraries. The second is just the places where version number or library has changed. I'm not sure if this helps, but I am hoping someone who knows more about this would have some thoughts.Below is a more narrow list of just where versions have changed.
Zeitsperre commentedon Sep 19, 2022
The newest release (1.6.1) hasn't fixed the problems for my use case either:
giovaniceotto commentedon Oct 25, 2022
@jswhit, I am available to do some digging and try to solve this issue since it is causing a lot of problem for other libraries. Do you have any suggestions to where should I start looking?
ocefpaf commentedon Oct 25, 2022
This is not a solution, just a work around, but you can try:
and then,
I'll check the openssl version used and try to add a regression test in the wheel building process to investigate. I can confirm that this doesn't happen in the Windows wheel and @ngam confirmed it doesn't happen in the M1 wheel. It must be the Linux openssl version then.
ebettenc commentedon Oct 27, 2022
In the Aug 8 traceback above (and pasted below), the URL string gets turned into a byte string by netCDF4. Could that be relevant? I had this problem and fixed it by using an older version of netCDF4 that keeps the string as a string. There was a similar issue with strings converted to byte strings 2 years ago: pydata/xarray#4859
Traceback (most recent call last):
File "", line 1, in
File "src/netCDF4/_netCDF4.pyx", line 2353, in netCDF4._netCDF4.Dataset.init
File "src/netCDF4/_netCDF4.pyx", line 1963, in netCDF4._netCDF4._ensure_nc_success
OSError: [Errno -68] NetCDF: I/O failure: b'http://thredds.socib.es/thredds/dodsC/hf_radar/hf_radar_ibiza-scb_codarssproc001/L1/2016/dep0001_hf-radar-ibiza_scb-codarssproc001_L1_2016-02.nc'
bertcoerver commentedon Apr 5, 2023
Still having this problem with netcdf4==1.6.3.
Gui-FernandesBR commentedon Jun 9, 2023
I just used the colab notebook pinned in the first comment and used the new
netcdf4==1.6.4version.Everything is running as expected,
I think this issue was solved.
See #1246 (comment)
ocefpaf commentedon Jun 9, 2023
There are a few overlapping issues that may be closed. Posting them here to facilitate closing later:
#1199
#812
#753