Page 1 of 1

Error in running the "example.py" demo

Posted: Mon Jan 22, 2024 6:57 am
by yonsen
Dear Francois,
First of all, thank you very much for developing and sharing POLYMER. This is my first time working with it. Previously, I am working well with other atmospheric correction program or radiation transfer model, such as 6S, ACOLITE, C2RCC, FLASSH. I tried to use polymer in the window 11 and anoconda. I've added the following two lines in ./polymer/main.py, because I got the following error:" ImportError: cannot import name 'Level1' from 'polymer.main'".
from polymer.level1 import Level1
from polymer.level2 import Level2
After adding these, the program (the example.py demo) seem moving on, then i got the following error:

Traceback (most recent call last):
File "D:\Research\tools\polymer-v4.17beta2\example.py", line 4, in <module>
from polymer.main import run_atm_corr, Level1, Level2
ImportError: cannot import name 'Level1' from 'polymer.main' (D:\Research\tools\polymer-v4.17beta2\polymer\main.py)
(research) PS D:\Research\tools\polymer-v4.17beta2> python .\example.py
Traceback (most recent call last):
File "C:\Users\liuyo\AppData\Roaming\Python\Python311\site-packages\glymur\config.py", line 135, in glymur_config
opj_lib = loader(path)
^^^^^^^^^^^^
File "D:\ProgramData\anaconda3\envs\research\Lib\ctypes\__init__.py", line 454, in LoadLibrary
return self._dlltype(name)
^^^^^^^^^^^^^^^^^^^
File "D:\ProgramData\anaconda3\envs\research\Lib\ctypes\__init__.py", line 366, in __init__
if '/' in name or '\\' in name:
^^^^^^^^^^^
TypeError: argument of type 'WindowsPath' is not iterable

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "D:\Research\tools\polymer-v4.17beta2\example.py", line 10, in <module>
from polymer.level1_msi import Level1_MSI
File "D:\Research\tools\polymer-v4.17beta2\polymer\level1_msi.py", line 7, in <module>
from glymur import Jp2k
File "C:\Users\liuyo\AppData\Roaming\Python\Python311\site-packages\glymur\__init__.py", line 12, in <module>
from glymur import version
File "C:\Users\liuyo\AppData\Roaming\Python\Python311\site-packages\glymur\version.py", line 19, in <module>
from .lib import tiff
File "C:\Users\liuyo\AppData\Roaming\Python\Python311\site-packages\glymur\lib\tiff.py", line 21, in <module>
_LIBTIFF = glymur_config('tiff')
^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\liuyo\AppData\Roaming\Python\Python311\site-packages\glymur\config.py", line 140, in glymur_config
opj_lib = loader(path)
^^^^^^^^^^^^
File "D:\ProgramData\anaconda3\envs\research\Lib\ctypes\__init__.py", line 454, in LoadLibrary
return self._dlltype(name)
^^^^^^^^^^^^^^^^^^^
File "D:\ProgramData\anaconda3\envs\research\Lib\ctypes\__init__.py", line 376, in __init__
self._handle = _dlopen(self._name, mode)
^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: Could not find module 'D:\ProgramData\anaconda3\envs\research\Library\bin\tiff.dll' (or one of its dependencies). Try using the full path with constructor syntax.

Can anyone help me with this, or sharing your solution, or any ideas. Thanks all.

Re: Error in running the "example.py" demo

Posted: Mon Jan 22, 2024 7:13 am
by sakvaka_env
Polymer isn't compatible with Windows.