netcdf4-python
netcdf4-python copied to clipboard
invalid argument reading error when running on a server
Hi, I would appreciate very much your help.
I have created my env miniconda on Linux:
conda create --name Python36-env python=3.6
conda activate Python36-env
conda install netcdf4
Then I am trying to run my script as:
python example.py
And I get the error:
File "Data_extraction.py", line 13, in
Lines in my script regarding netcfd4:
from netCDF4 import Dataset mapIn='Y:/damdam/example.nc' nf = Dataset(mapIn,'r') ids = len(nf.variables['river_cell'][:]) etc.
so when I do: conda list in cmp I see that I have my netcdf4 installed but when running on the server I get an error. If I run it locally on my computer I do not have any problem. That was the reason why I created virtual env on a server but the problem is still there.
Any suggestion? Thanks a lot,
Cheers
Marc
I have experienced this, too. The key thing to notice in the traceback is that the filename path string is being shown as a byte-string even though a byte string wasn't passed in. Somewhere in the process, the path string is getting converted into a byte string. I haven't figured out the exact circumstances, but it looks like the problem started with v1.6.1.
Seeing that this issue was opened in 2020, well before the v1.6.1 release, this is probably not exactly the same as my bug, but I do think the byte-string is an important clue.