ImportError on first run of Polymer

Post Reply
Moritz
Posts: 2
Joined: Thu Nov 01, 2018 2:24 am
company / institution: Centre for Space Science Technology

ImportError on first run of Polymer

Post 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
acoque
Posts: 1
Joined: Fri May 26, 2023 5:03 pm
company / institution: INRAE
Location: France

Re: ImportError on first run of Polymer

Post 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).
Moritz
Posts: 2
Joined: Thu Nov 01, 2018 2:24 am
company / institution: Centre for Space Science Technology

Re: ImportError on first run of Polymer

Post by Moritz »

Thank you!
I wonder how I could have missed the previous post.
Moritz
Post Reply