nansencenter / nansat

Scientist friendly Python toolbox for processing 2D satellite Earth observation data.
http://nansat.readthedocs.io
GNU General Public License v3.0
182 stars 66 forks source link

nansat installation unexpected error #550

Closed jwLuo6413 closed 5 months ago

jwLuo6413 commented 5 months ago

I follow the instructions following this link: https://github.com/nansencenter/nansat/blob/master/docs/source/installation.rst. After installing nansat and its optional packages, I try to use nansat read sentinel-1 zip file and Geotiff file. Both of them give me the same error like this:

Traceback (most recent call last): File "", line 1, in File "/home/ljw/miniconda3/envs/py3nansat/lib/python3.7/site-packages/nansat/nansat.py", line 156, in init self.vrt = self._get_mapper(mapper, kwargs) File "/home/ljw/miniconda3/envs/py3nansat/lib/python3.7/site-packages/nansat/nansat.py", line 1157, in _get_mapper tmp_vrt = nansatMappers[iMapper](self.filename, gdal_dataset, metadata, kwargs) File "/home/ljw/miniconda3/envs/py3nansat/lib/python3.7/site-packages/nansat/mappers/mapper_sentinel1_l1.py", line 185, in init self.create_bands(metaDict) File "/home/ljw/miniconda3/envs/py3nansat/lib/python3.7/site-packages/nansat/vrt.py", line 926, in create_bands self.create_band(src, dst) File "/home/ljw/miniconda3/envs/py3nansat/lib/python3.7/site-packages/nansat/vrt.py", line 1007, in create_band dst['name'], wkv = self._create_band_name(dst) File "/home/ljw/miniconda3/envs/py3nansat/lib/python3.7/site-packages/nansat/vrt.py", line 706, in _create_band_name wkv_pti = pti.get_wkv_variable(str(wkv_dst)) File "/home/ljw/miniconda3/envs/py3nansat/lib/python3.7/site-packages/pythesint/vocabulary.py", line 45, in find_keyword for d in self.get_list(): File "/home/ljw/miniconda3/envs/py3nansat/lib/python3.7/site-packages/pythesint/json_vocabulary.py", line 22, in get_list result = json.load(opened_file) File "/home/ljw/miniconda3/envs/py3nansat/lib/python3.7/json/init.py", line 296, in load parse_constant=parse_constant, object_pairs_hook=object_pairs_hook, **kw) File "/home/ljw/miniconda3/envs/py3nansat/lib/python3.7/json/init.py", line 348, in loads return _default_decoder.decode(s) File "/home/ljw/miniconda3/envs/py3nansat/lib/python3.7/json/decoder.py", line 337, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "/home/ljw/miniconda3/envs/py3nansat/lib/python3.7/json/decoder.py", line 355, in raw_decode raise JSONDecodeError("Expecting value", s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

I think maybe this relates with "pythesint", so I try to update local JSON vocabularies following this link: https://github.com/nansencenter/py-thesaurus-interface/tree/master. But when I try to run "import pythesint as pti; pti.update_cf_standard_name(version='20210119T185509')" or "import pythesint as pti; pti.update_cf_standard_name()", it gives me error like this: Downloading and writing json file for cf_standard_name /home/ljw/.local/share/pythesint/json 段错误

Can anyone give me some hints about this? How to fix it?

aperrin66 commented 5 months ago

Hi @jwLuo6413, can you export your anaconda environment (see instructions here) and attach the environment.yml file in this conversation, so that I can try to reproduce that error?

jwLuo6413 commented 5 months ago

@aperrin66 Thanks for your kindness :). Details about "environment.yml" shows below:

name: py3nansat channels:

aperrin66 commented 5 months ago

Your issue does look like you need to update the pythesint data. However, I am unable to reproduce the segmentation fault you get (if that is the error you get, I had to use google translate for this one).

Can you try to remove all pythesint data (in ~/.local/share/pythesint/ by default) and run the following after making sure your anaconda environment is activated?

python -c 'import pythesint;pythesint.update_all_vocabularies()'

jwLuo6413 commented 5 months ago

@aperrin66 Thanks for your help and now I can use "Nansat" package normally. Actually, I still encounter another issue when I type "python -c 'import pythesint;pythesint.update_all_vocabularies()'" in the command line after activating 'py3nansat' environment. it shows below:

requests.exceptions.ConnectionError: HTTPSConnectionPool(host='raw.githubusercontent.com', port=443): Max retries exceeded with url: /nansencenter/nersc-vocabularies/master/nansat_wkv.yml (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f9428fd3450>: Failed to establish a new connection: [Errno 111] Connection refused'))

It seems that this error associated with host 'raw.githubusercontent.com' connection, I solved this issue by searching its corresponding ipv4 address and added this address and host name in "hosts" file, which should be located in "C:\Windows\System32\drivers\etc\" directory in wIndows system.

Hope my problem-solving journey can benefit others who could come across the same issue like me in the future. Thanks again!