Sen2Cor installed under Anaconda in users’ home directory, just like instructions… when we try to use Sen2Cor, this appears in SNAP message log:
INFO [org.esa.snap]: File “/home/dstrom/anaconda2/lib/python2.7/site-packages/sen2cor-2.3.1-py2.7.egg/sen2cor/L2A_Process.py”, line 7, in
INFO [org.esa.snap]: from tables import *
SEVERE [org.esa.snap]: ImportError: No module named tables
INFO [org.esa.snap]: Process exited with value 1
INFO [org.esa.snap]: Finished tool execution in 0 seconds
So, why is L2A_Process.py looking for module tables in python 2.7? How do I fix?
This is just what is in the install instructions:
dstrom@afsisdata2:~$ python
Python 2.7.12 |Anaconda 4.2.0 (64-bit)| (default, Jul 2 2016, 17:42:40)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] on linux2
dstrom@afsisdata2:~$ pip uninstall pytables
Cannot uninstall requirement pytables, not installed
You are using pip version 8.1.2, however version 9.0.1 is available.
You should consider upgrading via the ‘pip install --upgrade pip’ command.
dstrom@afsisdata2:~$ pip install pytables
Collecting pytables
Could not find a version that satisfies the requirement pytables (from versions: )
No matching distribution found for pytables
You are using pip version 8.1.2, however version 9.0.1 is available.
You should consider upgrading via the ‘pip install --upgrade pip’ command.
dstrom@afsisdata2:~$ which pip
/home/dstrom/anaconda2/bin/pip
dstrom@afsisdata2:~$ history | grep pytable
896 pip install pytables
898 conda install pytables
959 conda install pytables
1012 pip uninstall pytables
1013 pip install pytables
1015 history | grep pytable
dstrom@afsisdata2:~$ conda uninstall pytables
Fetching package metadata …
Solving package specifications: .
Package plan for package removal in environment /home/dstrom/anaconda2:
INFO [org.esa.snap]: Traceback (most recent call last):
INFO [org.esa.snap]: File “/home/dstrom/anaconda2/lib/python2.7/site-packages/sen2cor-2.3.1-py2.7.egg/sen2cor/L2A_Process.py”, line 7, in
INFO [org.esa.snap]: from tables import *
SEVERE [org.esa.snap]: ImportError: No module named tables
INFO [org.esa.snap]: Process exited with value 1
INFO [org.esa.snap]: Finished tool execution in 0 seconds
I was having a similar problem. If I recall correctly, the problem is because it is basically not finding python. I think all you have to do is remember to call (L2A_Bashrc is located in your SEN2COR_HOME folder)
source L2A_Bashrc
in your shell before you call L2A_Process , so that SEN2COR_HOME, SEN2COR_BIN and GDAL_DATA are exported.
Hope this solves the problem
Edit: Just realized you are calling sen2cor within SNAP, right? Maybe the env variables I mentioned above are not well defined in SNAP then?