OpenJPEG installation

Hi, I’ve just been through the installation process for sen2cor, but I am receiving this error (see image) when I try to run sen2cor.

True to the error, after typing ‘conda list’ into the Anaconda prompt, OpenJPEG isn’t there. I have downloaded OpenJPEG 2.1.2 but have no idea how to correctly install this in Anaconda to correct the sen2cor error.

Does anyone know how to do this?

I am on Windows 10, gdal 2.1.0 and Glymur 0.8.6

Thank you for any help!

I also seem to get this error when I try run Sen2Cor with 10/20m resolution

I’m not an expert at this but OpenJPEG should be either included in the installation of SNAP or in Anaconda.

I thought so as I can’t seem to find much online about this issue, but you can see on Anaconda’s package list that it isn’t there:

Could this be related to the GDAL section that appears at the top of my command prompt?

I’m sorry, I have never used a command prompt before a few hours ago, so I am still getting used to what the information being displayed means :slight_smile:

no need to apologize, you are doing fine!

I found that it may be related to the glymur package. I did a file search for “openjp” in my Python installation folder and got the following results.

As you see, most of them are included in the glymur package. Do you get similar search results?

Maybe more important: Is glymur in your pip list? Which version?

I get similar results from the search:

When I retrieve the conda list in the command prompt, glymur appears as the folowing:

Glymur 0.8.6

Is this a problem?


maybe the glymur installation was not complete.
I have version 0.8.4 by the way.

You could try

pip uninstall glymur

followed by
pip install glymur

I gave that a go, but still have the same problem. I have just installed openjpeg using:

conda install -c conda-forge openjpeg=2.1.2

in the command prompt, which I found here:

did this change anything?

It’s not throwing up any error, but that’s because it’s not doing anything really. It has been stuck on 0% for a good 20 minutes. Or is this how long sen2cor takes to work? :smiley:

something should happen (or be printed) at least…

I know that sen2cor is sensitive to versions. Maybe you try openjpg version 1.5 instead (as suggested minimum from the error message).

I tried to install version 1.5 by altering the command I used to install 2.1.2, but this didn’t work:

After restarting my computer and re running sen2cor, I did start getting an error message:

I’ve opened up the logs and attached the section from this attempt below:
20170629_0955.txt (2.1 KB)

I’m now going to have a look at the that was found in the search yesterday. It seems unusual that an openjpeg program existed but was not discovered by anaconda

I followed this advice, and it is looking promising so far!

good to hear. Let us know if you were able to resolve your problem.

Finally got it working! after the ‘bool’ error was fixed I then got a ‘float’ object error. This was then fixed with this:

After the numpy downgrade Sen2Cor finally started working. I will create a summary of the succession of issues and fixes I went through and post it here shortly

Thanks for the help Andreas!

that would be perfect! We can then mark the post as solution so other users struggling with similer issues find it faster.

When receiving the below error in the Sen2Cor Execution Output:

RuntimeError: You must have at least version 1.5.0 of OpenJPEG installed before you can read JPEG2000 images with glymur. Your version is 0.0.0

  1. Open the Anaconda prompt

  2. Get the latest version of glymur using commands:
    2.1) pip uninstall glymur
    2.2) pip install glymur
    see OpenJPEG installation

  3. Install OpenJPEG using command:
    conda install -c conda-forge openjpeg=2.1.2
    See OpenJPEG installation

After this, I was receiving the below error:

AttributeError: ‘bool’ object has no attribute ‘text’

This was because an L2A folder existed from the previous failed attempts

  1. Delete any previous L2A folders
    see Sen2cor process : AttributeError: 'bool' object has no attribute 'Size'

I then received the below error:

TypeError: ‘float’ object cannot be interpreted as an index

  1. Open the Anaconda prompt
  2. Downgrade the numpy version using:
    pip install numpy==1.11.3
    see Sen2cor 2.3.1 processing error
1 Like

great, thank you.