Can't install Sen2Cor

Hi everyone,

I have a problem installing Sen2Cor. I installed newest Anaconda and downloaded Sen2Cor 2.0.6 but when I run >python setup.py install I get the following message:

Traceback (most recent call last):
File “setup.py”, line 240, in
copy_file(libOpj2Source, libOpj2Target)
File “/home/rasdaman/anaconda3/lib/python3.4/distutils/file_util.py”, line 105, in copy_file
“can’t copy ‘%s’: doesn’t exist or not a regular file” % src)
distutils.errors.DistutilsFileError: can’t copy ‘/home/rasdaman/anaconda3/lib/python2.7/site-packages/sen2cor-2.0.6-py2.7.egg/sen2cor/build/lib.linux-x86_64-2.7/libopenjp2.so’: doesn’t exist or not a regular file

I tried to install on both Win 7 x64 and Ubuntu 14.04 x64, but I get the same error? I searched the other questions and answers, but none of the problems seems familiar to this one. Any ideas how I can fix this?

Thanks,
Ognjen

Hi Ognjen,

I may be wrong but did you install Anaconda 3.5 instead of Anaconda 2.7?

Cheers,
Andreas

1 Like

Oh, you are right.
And I couldn’t figure out what was the problem, didn’t pay attention to that.
Thanks a lot!

Best,
Ognjen

Hello,

I’ve been having the same problem, and I’m pretty sure I installed Anaconda for Python 2.7 (on an Ubuntu 14.04 OS). Do you have any other suggestions? I installed it in the /home/username/ space, as was suggested in the installation notes.
Thanks!
Kamen

Does your username may have a “space character” inbetween? This was also an error I had once. :slight_smile:

Hi, do you mean the username for the machine I’m installing on? No, no space in the username.
I am not sure what magic the setup script is doing, but it seems to be copying stuff from a non-existing directory. I really don’t know what to do next, and would appreciate any help.

OK I figured it out - it was a sort of a silly thing. My sudo PATH didn’t have Anaconda in it, as opposed to my regular user’s PATH. I fixed it with an alias in my .bashrc:
alias sudo=‘sudo -E env “PATH=$PATH”’

Thanks for the help anyway!

I ran into a different problem, probably having to do with paths again:

~$ L2A_Process --help
Traceback (most recent call last):
File “/home/agromo/anaconda2/bin/L2A_Process”, line 9, in
load_entry_point(‘sen2cor==2.2.1’, ‘console_scripts’, ‘L2A_Process’)()
File “/home/agromo/anaconda2/lib/python2.7/site-packages/setuptools-23.0.0-py2.7.egg/pkg_resources/init.py”, line 542, in load_entry_point
File “/home/agromo/anaconda2/lib/python2.7/site-packages/setuptools-23.0.0-py2.7.egg/pkg_resources/init.py”, line 2569, in load_entry_point
File “/home/agromo/anaconda2/lib/python2.7/site-packages/setuptools-23.0.0-py2.7.egg/pkg_resources/init.py”, line 2229, in load
File “/home/agromo/anaconda2/lib/python2.7/site-packages/setuptools-23.0.0-py2.7.egg/pkg_resources/init.py”, line 2235, in resolve
File “/home/agromo/anaconda2/lib/python2.7/site-packages/sen2cor-2.2.1-py2.7.egg/sen2cor/L2A_Process.py”, line 13, in
from L2A_Schedule import L2A_Schedule
File “/home/agromo/anaconda2/lib/python2.7/site-packages/sen2cor-2.2.1-py2.7.egg/sen2cor/L2A_Schedule.py”, line 11, in
from L2A_ProcessTile import L2A_ProcessTile, SUCCESS, FAILURE
File “/home/agromo/anaconda2/lib/python2.7/site-packages/sen2cor-2.2.1-py2.7.egg/sen2cor/L2A_ProcessTile.py”, line 14, in
from L2A_AtmCorr import L2A_AtmCorr
ImportError: No module named L2A_AtmCorr

Any suggestions?

Hi
Do you find a solution for that error?
Because I have the same issue, Python doesn’t find a module named L2A_AtmCorr

Thanks