Sen2cor L2A_Process ImportError


I am facing a problem getting sen2cor to work using OSX Terminal. I installed Anaconda and sen2cor as described in the Manual, but when I type
L2A_Process --help
i receive the following:

Leons-MacBook-Pro:~ leonnill$ L2A_Process --help
Traceback (most recent call last):
File “/Users/leonnill/anaconda/bin/L2A_Process”, line 11, in
load_entry_point(‘sen2cor==2.3.1’, ‘console_scripts’, ‘L2A_Process’)()
File “/Users/leonnill/anaconda/lib/python2.7/site-packages/setuptools-27.2.0-py2.7.egg/pkg_resources/”, line 565, in load_entry_point
File “/Users/leonnill/anaconda/lib/python2.7/site-packages/setuptools-27.2.0-py2.7.egg/pkg_resources/”, line 2598, in load_entry_point
File “/Users/leonnill/anaconda/lib/python2.7/site-packages/setuptools-27.2.0-py2.7.egg/pkg_resources/”, line 2258, in load
File “/Users/leonnill/anaconda/lib/python2.7/site-packages/setuptools-27.2.0-py2.7.egg/pkg_resources/”, line 2264, in resolve
File “/Users/leonnill/anaconda/lib/python2.7/site-packages/sen2cor-2.3.1-py2.7.egg/sen2cor/”, line 14, in
from L2A_Schedule import L2A_Schedule
File “/Users/leonnill/anaconda/lib/python2.7/site-packages/sen2cor-2.3.1-py2.7.egg/sen2cor/”, line 11, in
from L2A_ProcessTile import L2A_ProcessTile, SUCCESS, FAILURE
File “/Users/leonnill/anaconda/lib/python2.7/site-packages/sen2cor-2.3.1-py2.7.egg/sen2cor/”, line 12, in
from L2A_Tables import L2A_Tables
File “/Users/leonnill/anaconda/lib/python2.7/site-packages/sen2cor-2.3.1-py2.7.egg/sen2cor/”, line 26, in
from osgeo.gdal_array import BandReadAsArray
File “/Users/leonnill/anaconda/lib/python2.7/site-packages/osgeo/”, line 21, in
_gdal = swig_import_helper()
File “/Users/leonnill/anaconda/lib/python2.7/site-packages/osgeo/”, line 17, in swig_import_helper
_mod = imp.load_module(’_gdal’, fp, pathname, description)
ImportError: dlopen(/Users/leonnill/anaconda/lib/python2.7/site-packages/osgeo/, 2): Library not loaded: @rpath/libjpeg.8.dylib
Referenced from: /Users/leonnill/anaconda/lib/libgdal.20.dylib
Reason: image not found

I appreciate any idea on how to fix this. Thanks!


I was able to solve the issue thanks to creynold’s comment on a similar problem:

If anyone should face the same problem:
copy the file “libjpeg.8.dylib” from /anaconda/lib to usr/local/lib (in case you do not have this file there use conda install -f jpeg=8 to receive it)

I had a similar problem on OS Sierra. Since it took me awhile to figure it out, I thought I would share: in my case just copying jpeg.8 was not enough. I had to run the update command twice and also add jpeg.9 to usr/local/lib

Same issue here running on a Mac 10.12.6. Solved copying dylib to usr/local/lib , so thanks nleon.