Sen2cor installing error

I have the same problem on my desktop computer (Windows 7).

did you solve the error?

No, on an other computer it worked. So I am using it there. But I would still be interested into a solution. :slight_smile:

I posted it hopping that someone help us, because many of my colleagues have the same problem

I also have the same problem…
I’m using a Win7 Enterprise 64bits version
any help on this?
Thanks!

Hi all,

I have the same problem with sen2cor 2.0.6 using Ubuntu 14.04 LTS. I also tried using an older anaconda version, but it didn’t solve the problem. What is really annoying, I got sen2cor 2.0.4 perfectly running with the same settings (same Ubuntu & same Anaconda).

Cheers,
Jan

Dear jouzemou.
Firstly, you should correct the warning of “openjp2.dll could not be loaded” by this link “Openjp2 is not be loaded”.

Then type “L2A_Process --help” and show me the result.

Best.

I found a work around for Ubuntu!

In Ubuntu the libcom_err.so.3 file seems to be missing. It seems to be a current anaconda vs. gdal problem. I found a solution here.

Open Terminal and simply do the following:

`locate libcom_err`

You will get back a list. In my case only libcom_err.so.2 was listed. So I created a symbolic link, as explained in the link above, by navigating into the libcom_err.so.2 directory. In my case it was

`cd /lib/x86_64-linux-gnu`

And now create the link by entering

`sudo ln -s libcom_err.so.2 libcom_err.so.3`

@JanMil I tested sen2cor installation recently on my Ubuntu 14.04 laptop and did not encounter this error.
Did you upgrade anaconda to the latest version ? Or did you try reinstalling the latest anaconda and re-doing the sen2cor installation ?

@JanMil on my anaconda 2.3.0 installation, I do have pkgs/krb5-1.13.2-0/lib/libcom_err.so.3

I tried different anaconda versions, older and new ones. To be on the safe side I have always set up a new virtual machine with a fresh Ubuntu installation. I didn’t have this problem when I installed sen2cor 2.0.4 in November 2015. Now it doesn’t make a difference if I use sen2cor 2.0.4, 2.0.5 or 2.0.6, I always get the same error no matter which anaconda version. BTW the sen2cor installation always updates anaconda to the most current version.

Is completely missing in my installation

github is missing binary components, you need the zip/tar

edit: i stand corrected

I didn’t get it from github. I downloaded the tar.gz from http://s2tbx.telespazio-vega.de/sen2cor/

This is a test, only if you observe the described problem when trying to run sen2cor on windows:

C:\Anaconda\lib\site-packages\Glymur-0.8.0-py2.7.egg\glymur\lib\config.py:102:
UserWarning: The library specified by configuration file at C:\Anaconda\Scripts\openjp2.dll could not be loaded.

  1. download this folder:

http://s2tbx.telespazio-vega.de/sen2cor/testopenjp2_win-amd64

into a directory of your choice

  1. open the command line prompt and execute ‘test.bat’.

Please do not execute testopenjp2.exe directly. It might load your old corrupt openjp2.dll instead, as it is
found via the PATH environment variable. Test.bat will temporarily modify the path in order to load the new dll.

If you then receive the following message (or similar):
openjp2.dll = <PyInstallerWinDLL ‘openjp2.dll’, handle 68ac0000 at 1eed160>
The library could be loaded.

you can take the file ‘openjp2.dll’ from this directory
and replace the file with the same name, located in the Anaconda\Scripts directory:

C:\Users\XYZ\Anaconda\Scripts

After this modification, the processor should run.
The new processor, which will be released within the next days will have the new dll by default.

However, if you still receive an error message like:
openjp2.dll = None
The library could NOT be loaded.
Then please post this result in the forum, as then our theory would be wrong.

most probable reason for the problem observed by a couple of users as we currently can identify:

The openjpeg DLL shipped with the previous versions of sen2cor was compiled with VC++.
The DLL needs msvcr120.dll and msvcp120.dll to load properly.
These two libraries are in most cases part of the windows installation under Windows\System32,
but in some cases, they are apparently not present.

The new library is build with mingw, and has no longer any dependency to the VC++ runtime dll.

Hi Uwe,
have you been following what was discussed here? For Ubuntu we came to the conclusion that one major issue is the automatic dependency update during installation. One problem for example was the downgrade of gdal to 1.19 and libgdal to 1.x. Later in the process some other package updates gdal to 2.x but the libgdal stays at 1.x. You can imagine that this will result in errors. @agrapentin share a solution how to turn the dependency update off in the setup.py script. Are you aware of this problem?
Cheers
Jan

Yes, I am actually updating and testing the dependencies. The problem will be solved with the coming release. Here is the history which explains what happened, and why these dependencies on numpy 19 had been present:

When the last build of Sen2cor had been performed in autumn of last year, the following issue was given:

the necessary gdal tools intrinsically installed by anaconda had been incomplete, so that no DEM could be created.

I thus derived the gdal installation package from:
https://anaconda.org/osgeo/gdal/files istead in order to get the gdal tools running,

which however had the dependency of numpy version 19. This is the reason why the downgrade was performed in the installation script, as it needed the correct gdal tools. see also:

During the upgrade of Anaconda which occurred in the meantime, this dependency to numpy 19 now leads to the errors you observed.

In the meantime, Anaconda had also included a proper version of gdal 2.0 including all needed programs like gdalwarp and gdaldem, so that these dependencies are no longer needed. This is also the reason why you have been successful in removing the dependencies.

The new installer will fix these issues.

1 Like

Morning, some slightly different error messages as I try and install sen2cor. Okay, technical details:

Running Windows 8.1, 64 bit. Installed last week Anaconda3 from its web site (it checks fine). Downloaded sen2cor-2.0.6 from telepazio website.

I unzipped the folder on my C drive. And ran “python setup.py install” and the following error messages were produced:

File “c:\anaconda3\lib\site-packages\sencor-2.0.6-py3.5.egg\sen2cor\L2A_Config.py”, line 2701
except Exception, inst:
SyntaxError: invalid syntax

And at the end:

File “setup.py”, line 240 in
copy_file(lib0pj2source,lib0pj2Target)
File “C:\Anaconda\lib\disutils\file_util.py”, line 105, in copy_file
copy ‘%s’:doesn’t exist or not a regular file’ % src
disutils.errors.DistutilsFileError: can’t copy ‘C:|Anaconda3\Lib\site-packages
sen2cor-2.0.6-py2.7.egg\sen2cor\build\lib.win-amd64-2.7\openjp2.dll’: doesn’t exist or not a regular file

Re-install Anaconda3 or what to try next? Suggestions appreciated.

Please go to the new version of sen2Cor 2.2.1 as can be downloaded from here:

http://step.esa.int/main/third-party-plugins-2/sen2cor/

The problem with the incompatible (old) gdal libraries is fixed in the new Version, as a lot of other problems. Please follow the release note for an overview.

Thanks! Runs fine. But I’ll probably be starting a new thread with new questions…the joys of science! :slight_smile: