Page 1 of 1

error of processing sentinel-2

Posted: Sat Oct 09, 2021 10:26 am
by ruochen11
Hello everyone
i try to process sentinel use polymer_cli.py
the error is:
./polymer_cli.py /home/a/Sentinel-2/L1/S2A_MSIL1C_20201017T022711_N0209_R046_T52TCP_20201017T043702.SAFE/GRANULE/L1C_T52TCP_A027785_20201017T023425/ /home/a/Sentinel-2/17.nc
Starting processing at 2021-10-09 03:19:30.218156
Traceback (most recent call last):
File "./polymer_cli.py", line 35, in <module>
Level2(filename=args.output_file, fmt=args.fmt))
File "/home/a/polymer-v4.13/polymer/main.py", line 496, in run_atm_corr
with level2 as l2, level1 as l1:
File "/home/a/polymer-v4.13/polymer/level1.py", line 100, in __enter__
from polymer.level1_msi import Level1_MSI
File "/home/a/polymer-v4.13/polymer/level1_msi.py", line 7, in <module>
from glymur import Jp2k
File "/home/a/anaconda3/lib/python3.6/site-packages/glymur/__init__.py", line 8, in <module>
from .jp2k import Jp2k
File "/home/a/anaconda3/lib/python3.6/site-packages/glymur/jp2k.py", line 26, in <module>
from .jp2box import (
File "/home/a/anaconda3/lib/python3.6/site-packages/glymur/jp2box.py", line 26, in <module>
from osgeo import gdal
File "/home/a/anaconda3/lib/python3.6/site-packages/osgeo/__init__.py", line 21, in <module>
_gdal = swig_import_helper()
File "/home/a/anaconda3/lib/python3.6/site-packages/osgeo/__init__.py", line 17, in swig_import_helper
_mod = imp.load_module('_gdal', fp, pathname, description)
File "/home/a/anaconda3/lib/python3.6/imp.py", line 243, in load_module
return load_dynamic(name, filename, file)
File "/home/a/anaconda3/lib/python3.6/imp.py", line 343, in load_dynamic
return _load(spec)
ImportError: libcharset.so.1: cannot open shared object file: No such file or directory
How to fix this problem? Thank you in advance!

Kind regards,
Tian.

Re: error of processing sentinel-2

Posted: Mon Dec 20, 2021 1:10 pm
by fsteinmetz
Hello,

Sorry for the late reply. This problem seems to be due to the installation of the python environment, because the failure happend at "from osgeo import gdal".
I recommend to have a look at the latest Polymer release v4.14, which should provide a better installation procedure using anaconda environments.
I hope this helps,
Cheers,
François

Re: error of processing sentinel-2

Posted: Fri Aug 11, 2023 2:11 pm
by tsilva
I was having the same problem as the gdal version installed was <2.0. Despite the channels specified in environment.yml this was version 1.9 from bioconda. Forcing install of gdal >2 from -c conda-forge solved the problem.

conda install gdal>2.0 -c conda-forge

Franc,ois, I suggest that the environment.yml file is corrected to express this incompabitlity with older gdal version:

- gdal>2.0

Another recent imcompatiliblity with with cython 3.0 so I suggest to add:
- cython<3.0
until polymer is is made compatible with Cython default compilation directives.

Tiago

Re: error of processing sentinel-2

Posted: Mon Aug 21, 2023 12:59 pm
by fsteinmetz
Thanks Tiago, I will check and update the dependencies in next release.