Page 1 of 1

ImportError on first run of Polymer

Posted: Wed May 31, 2023 6:19 am
by Moritz
Hi François,
this is probably a very basic rookie question: On first run (using polymer_cli.py, or a simple Python script), the following error occurs:

Code: Select all

Traceback (most recent call last):
  File "./polymer_cli.py", line 11, in <module>
    from polymer.main import run_atm_corr, Level1, Level2
ImportError: cannot import name 'Level1' from 'polymer.main' (/home/mlehmann/polymer-v4.16.1/polymer/main.py)
I am using polymer-v4.16.1 and created a Python environment as instructed in the .md file. My system is Ubuntu 22.04.2 LTS
Many thanks!
Moritz

Re: ImportError on first run of Polymer

Posted: Wed May 31, 2023 9:49 am
by acoque
Hi Moritz,
I faced the same issue and I replaced the line `from polymer.main import run_atm_corr, Level1, Level2` in "polymer_cli.py" with

Code: Select all

from polymer.main import run_atm_corr
from polymer.level1 import Level1
from polymer.level2 import Level2
You could also add the following lines in "polymer/main.py" (instead of modifying "polymer_cli.py"):

Code: Select all

from polymer.level1 import Level1
from polymer.level2 import Level2
Best,
Arthur

EDIT : ok, I just saw that it was already mentioned here (viewtopic.php?f=7&t=214).

Re: ImportError on first run of Polymer

Posted: Wed May 31, 2023 9:22 pm
by Moritz
Thank you!
I wonder how I could have missed the previous post.
Moritz