Installation Error

Post Reply
asim1212
Posts: 7
Joined: Mon Jul 29, 2019 10:51 am
company / institution: UiT, Norway
Location: Tromso

Installation Error

Post by asim1212 »

Hi,

I am trying to install Polymer in Linux but facing errors. Any help would be appreciated.

(polymer) mas108/Data/muhammad/polymer-v4.13$ make
python setup.py build_ext --inplace
Traceback (most recent call last):
File "setup.py", line 26, in <module>
EXTENSIONS = cythonize([SRC_DIR + '/*.pyx'],
File "/home/mas108/.conda/envs/polymer/lib/python3.8/site-packages/Cython/Build/Dependencies.py", line 965, in cythonize
module_list, module_metadata = create_extension_list(
File "/home/mas108/.conda/envs/polymer/lib/python3.8/site-packages/Cython/Build/Dependencies.py", line 815, in create_extension_list
for file in nonempty(sorted(extended_iglob(filepattern)), "'%s' doesn't match any files" % filepattern):
File "/home/mas108/.conda/envs/polymer/lib/python3.8/site-packages/Cython/Build/Dependencies.py", line 114, in nonempty
raise ValueError(error_msg)
ValueError: 'polymer/*.pyx' doesn't match any files
makefile:9: recipe for target 'main' failed
make: *** [main] Error 1
User avatar
fsteinmetz
Site Admin
Posts: 306
Joined: Fri Sep 07, 2018 1:34 pm
company / institution: Hygeos
Location: Lille, France
Contact:

Re: Installation Error

Post by fsteinmetz »

Hello,
You should have a directory "polymer" in your current directory, with pyx files in it. Can you confirm it is the case ?
Cheers,
François
Mengmeng
Posts: 38
Joined: Fri Mar 19, 2021 12:10 am
company / institution: Taishan University
Location: Taian, Shandong, China

Re: Installation Error

Post by Mengmeng »

Dear François,

May I ask at which step to install polymer? I did not see this step in the Readme file.

Thank you in advance!

Best regards,
Mengmeng.
User avatar
fsteinmetz
Site Admin
Posts: 306
Joined: Fri Sep 07, 2018 1:34 pm
company / institution: Hygeos
Location: Lille, France
Contact:

Re: Installation Error

Post by fsteinmetz »

Polymer is simply compiled (make all), and imported from the directory where it is compiled. Please see section 1 of the readme.
asim1212
Posts: 7
Joined: Mon Jul 29, 2019 10:51 am
company / institution: UiT, Norway
Location: Tromso

Re: Installation Error

Post by asim1212 »

I have done al these steps now but facing another error:

Traceback (most recent call last):
File "Run_Polymer.py", line 13, in <module>
from polymer.level1_ascii import Level1_ASCII
File "/Data/mas108/ResearchData/IFT/EarthObservation/ArvenEtterNansen/workspace/muhammad/Polymer/polymer-v4.13/polymer/level1_ascii.py", line 15, in <module>
from polymer.level1_nasa import tau_r_seadas_modis, tau_r_seadas_seawifs, tau_r_seadas_viirs
ImportError: cannot import name 'tau_r_seadas_viirs' from 'polymer.level1_nasa' (/Data/mas108/ResearchData/IFT/EarthObservation/ArvenEtterNansen/workspace/muhammad/Polymer/polymer-v4.13/polymer/level1_nasa.py)

I am using Python to run Polymer. And the python script is below:

python Run_Polymer.py


from polymer.main import run_atm_corr, Level1, Level2
from polymer.level2_hdf import Level2_HDF
from polymer.level2_nc import Level2_NETCDF
from polymer.level1_ascii import Level1_ASCII
from polymer.level1_nasa import Level1_NASA
from polymer.level1_olci import Level1_OLCI
from polymer.level1_msi import Level1_MSI
from pylab import plot

"""
Sentinel-2 MSI processing

Level1 can be specified as as granule name, like:
* S2A_OPER_PRD_MSIL1C_20160318T145513.SAFE/GRANULE/S2A_OPER_MSI_L1C_TL_SGS__20160318T232756_A003854_T19LDC_N02.01/
(as downloaded on https://scihub.copernicus.eu/)
* L1C_T51RTQ_A010954_20170728T024856/
(as downloaded with Sentinelhub: https://github.com/sentinel-hub/sentinelhub-py)
"""
run_atm_corr(Level1_MSI('/Data/mas108/ResearchData/IFT/EarthObservation/ArvenEtterNansen/workspace/muhammad/L8_S2_L1/LC82290012020094LGN00/S2A_MSIL1C_20200403T141731_N0209_R096_T33XVK_20200403T143357.SAFE/GRANULE/L1C*/',
resolution='30' # if not provided, use the 60m resolution
),
Level2_NETCDF() # by default, output in the same folder as input
)
User avatar
fsteinmetz
Site Admin
Posts: 306
Joined: Fri Sep 07, 2018 1:34 pm
company / institution: Hygeos
Location: Lille, France
Contact:

Re: Installation Error

Post by fsteinmetz »

Hi,
From your script, it seems that you don't need the level1_ascii.py module which triggers an error upon import.
Please import only the modules that are required by your script.
Cheers,
François
asim1212
Posts: 7
Joined: Mon Jul 29, 2019 10:51 am
company / institution: UiT, Norway
Location: Tromso

Re: Installation Error

Post by asim1212 »

It worked thanks.
Post Reply