Sen2cor run problem_ anaconda error

when I want to run sen2cor i face with this error:

the error text is:
C:\Program Files\Anaconda2\python.exe: can’t open file ‘C:\Users\KOWSAR\Anaconda2\Lib\site-packages\sen2cor-2.3.0-py2.7.egg\sen2cor/L2A_Process.py’: [Errno 2] No such file or directory
Process exited with value 2
Finished tool execution in 1 seconds

what can I do?

Hi,
It seems that you have installed Anaconda twice ( in different paths) and I think your system variables are not well configured. Could you try to set PYTHON_BIN and SEN2COR_BIN pointing to the same Anaconda installation folder?
This is:
PYTHON_BIN = C:\Program Files\Anaconda2\python.exe and SEN2COR_BIN = C:\Program Files\Anaconda2\Lib\site-packages\sen2cor-2.3.0-py2.7.egg\sen2cor

or
PYTHON_BIN = C:\Users\KOWSAR\Anaconda2\python.exe and SEN2COR_BIN = C:\Users\KOWSAR\Anaconda2\Lib\site-packages\sen2cor-2.3.0-py2.7.egg\sen2cor

Please, verify previously that the paths exist in your disk.

1 Like

about those paths (I found both of python.exe and sen2cor according to your mentioned text) I can’t understand your mean… you mean I have to copy sen2cor folder and paste it in Anaconda2 folder?

Hi Farnoosh,

is it currently working Sen2Cor in the command line? Please try: L2A_Process -h

If the output is this, sen2cor is properly installed:

In this case, to see which installation are you using, please try in the command line: where L2A_Process

If your output starts with: C:\Program Files\Anaconda2\ , then try to set the system variables

PYTHON_BIN = C:\Program Files\Anaconda2\python.exe
SEN2COR_BIN = C:\Program Files\Anaconda2\Lib\site-packages\sen2cor-2.3.0-py2.7.egg\sen2cor

If your output starts with: C:\Users\KOWSAR\Anaconda2\ , then try to set the system variables

PYTHON_BIN = C:\Users\KOWSAR\Anaconda2\python.exe
SEN2COR_BIN = C:\Users\KOWSAR\Anaconda2\Lib\site-packages\sen2cor-2.3.0-py2.7.egg\sen2cor

After that, please, uninstall and re-install the sen2cor plugin in SNAP.

If Sen2Cor is not working in the command line, I think that it is better to uninstall all the anacondas and sen2cor and make a clean installation.

2 Likes

Thanks a lot. I checked and saw may sen2cor is installed correctly, but after setting variables doesn’t work still so according to your suggestion I will uninstall and install all… Thanks again for your attention

dear Obarrilero, I reinstalled them all but I am still experiencing the same problem… after I installed Anaconda I checked it and there is no error as well as sen2cor installation, when I checked “L2A_Process --Help” also there wasn’t any errors. where is the problem?! I am confused :frowning:

did you try this:

1 Like

Hello again! please excuse me… I checked “where L2A_Process” and according to below figure

so when I want to change System variables according to your suggestion I only can change PYTHON_BIN, but SEN2COR_BIN isn’t changed:


actually I input “C:\Program Files\Anaconda2\Lib\site-packages\sen2cor-2.3.0-py2.7.egg\sen2cor” but after I click and select it return to the first path: “C:\Users\KOWSAR\Anaconda2\Lib\site-packages\sen2cor-2.3.0-py2.7.egg\sen2cor”… how can I change it?

Hi,

try to change it from the command line. Please see http://superuser.com/questions/79612/setting-and-getting-windows-environment-variables-from-the-command-prompt.

1 Like

thanks a loooooot Obarrilero… I am now in love with “setx” :smiley:

I could change variable, as you see, but when I want to use sen2cor I faced with the following error :

whats that mean?

thanks again

Can you please report the output that you get when executing from the command line?

thanks for your answering with patience …


the first is with help and the second is without I mean only LA_Process command

Please, try something like this:

where the S2A_OPER… should be a full path to a level 1C product or the product name if you are in the same folder.

1 Like

whats your mean from “d:\Produits_S2”? is that the path of Sentinel image (1C level) folder?

Yes, it is my local folder, where I have the L1C products.

1 Like

the report:

when I used sen2cor again now the results as following:


I confused! :expressionless:

I think you should remove = sign from --resolution=60, its should be --resolution 60. And also directory path is not well defined.

Hi,
did you try reinstall Anaconda2 to version 4.2 or 4.3?

Regards