-
Notifications
You must be signed in to change notification settings - Fork 265
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
v1.7.0 and v1.7.1 -- cannot open remote files #1342
Comments
Probably a duplicate of #1335 |
I can reproduce that but I have to confess I'm at a loss here. The test for this passes during the wheel build. See
Something is different from the build env and the final wheel :-/ I guess we should be building our own curl. I'll try to tackle that next week. |
@ocefpaf looks like we are not building our own netcdf-c from github develop - that's what we will need to do to fix this (or wait until 4.9.3 is released). I don't think building our own curl will help, although it is a mystery why the test passes during the wheel build. |
It should be latest netcdf-c: https://github.com/ocefpaf/netcdf-manylinux/blob/5d88292a012de0e7648edb6bb02f84ad8f630b9f/install_libs.sh#L43 And at some point I do recall downloading the wheel and testing it. Not sure what went wrong here. |
Probably not b/c the sdist happens in another image and the problem doesn't seems to exits in the macOS build, only on Linux. We can disable the ncgen tests (to remove the bew install), and isolate the sdist build more if you want to. BTW, indeed the test inside the image is useless b/c if you check the image out, install (or build) netCDF4, and test it there the tests pass:
or build it,
If you copy that wheel outside of the image and install it, the test will fail. I'm either missing something obvious, and/or building it against the images' curl and openssl is not OK. For now I'm trying to build openssl+curl to test if that would fix it, but the image is failing when running cmake for netcdf-c. Still debugging it in ocefpaf/netcdf-manylinux#1 |
OK, I think I got it. This is a wheel that is built with the latest image and I was able to install it and test against those URLs. netCDF4-1.7.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.zip I'm finalizing the image and we can send a PR to build them in the cibuildwheel GitHub Action for better testing. We have to download them and test locally though b/c the test in the image will pass regardless. |
@jswhit I'm clocking out for today but I believe that the images created in https://github.com/ocefpaf/netcdf-manylinux/actions/runs/9651107110/job/26618225405 will solve the problem. They build netcdf-c with latest openssl and curl, from source, and ship all the necessary parts for the netcdf4 wheel. The wheels built in https://github.com/Unidata/netcdf4-python/actions/runs/9652295373 used the Linux image already and I was able to use them locally without the any problem. The aarch64 is unsted b/c that image is quite slow and not built yet. I can't test it b/c I don't own any aarch64 hardware. The Windows and Mac Wheels are unchanged. If you believe this is good we can tag a 1.7.1.post1 release and yank 1.7.1 from PyPI. The source code is OK and only wheels require rebuilding, so no need for a new 1.7.2 release (unless you have a few more PRs to merge and add to the mix). |
as another test, I have a similar issue that affected my code. The import of the NetCDF4 library at 1.7.1 breaks things, even if not used by the rest of the code (which made it a bit hard to debug): import netCDF4
import xarray as xr
import s3fs
s3 = s3fs.S3FileSystem(anon=True)
file_path = 's3://imos-data/IMOS/SRS/SST/ghrsst/L3S-1d/dn/2024/20240101092000-ABOM-L3S_GHRSST-SSTfnd-AVHRR_D-1d_dn.nc'
# Open the file using s3fs
with s3.open(file_path, 'rb') as f:
ds = xr.open_dataset(f, engine='h5netcdf', concat_characters=True)
print(ds) ->
But with NetCDF4 1.6.5 , the same code works. |
@lbesnard you are using BTW, if you downgrade to |
@barronh 1.7.1.post1 was just released and it should fix this problem. Can you check with your remote files? |
I agree that in this example netCDF4 is not used. But this was actually my point. This is part of a bigger code which has other functions using the netCDF4 library. And just having this imported in a module breaks xarray as highlighted in my example. I'll try downgrading h5py , thanks! |
Thanks @ocefpaf and @jswhit! Your support of netcdf4 for python means so much to the community! And, your rapid response to issues is a model for us all! I confirm that 1.7.1.post1 solves the problem. I tested on both Google Colab and our computational cluster in a clean virtual environment. python -m pip install netcdf4==1.7.1.post1
python -c "import netCDF4; f = netCDF4.Dataset('https://www.ncei.noaa.gov/thredds/dodsC/model-ndgd-file/202406/20240616/LZQZ99_KWBP_202406161634')" Just in case, I want to note a few things for future issue readers who are installing with I leave the issue for you to close. Nothing so great as checking something off a list! |
Closing this one to avoid adding more h5py incompatibility discussion in the wrong issue. Thanks! |
The new v1.7.0 and v1.7.1 fail when reading remote files with a curl error. The v1.5.4 to v1.6.5 work for the exact same code. I'm not sure how to resolve this. It is likely related to a previous issue with earlier versions.
Environment
Steps to reproduce error:
The same error is seen with 1.7.1 and the line numbers even stay the same.
Steps to resolve error:
The text was updated successfully, but these errors were encountered: