I have a VM (RSS_CloudToolbox, Linux, CentOS 6.7) with SNAP (2.0.2), s2tbx and sen2cor already installed and running properly. Now I would like to run a python-script which uses snappy.
I wanted to install it as followed:
(As described: https://senbox.atlassian.net/wiki/display/SNAP/How+to+use+the+SNAP+API+from+Python )
But I get an unknow error message:
Did I do something wrong? What could be the problem? Do I may need administration rights?
Thanks for any help.
I have no idea what the cause might be.
Can you check if you have a
snappyutil.log file in
~/.snap/snap-python. If you have it, check its content. Maybe it gives some indication.
The VM admin told me he installed SNAP with Python but I can not find the directory ~/.snap/snap-python .
However I can find a directory /home//snap/ with folders:
and the files:
- SNAP Configuration Optimiser
- SNAP Desktop
- VERSION.txt (= 2.0.2)
~/.snap does not exist it means that snap never run before on that machine and also the snappy-conf did not work.
Try to run snappy-conf with an other target directory as the default.
./snappy-conf /home/pi/anaconda2/bin/python /home/mySnappy
Thank you for your hint. I started SNAP and generated an RGB and afterward I could find the .snap directory and the log-File. There was already an ImportError:
Afterward I tried to run ./snappy-conf /home/pi/anaconda2/bin/python /home/pi/snappy1 and I got an other error:
But a folder snappy in snappy1 was created. The module snappy is still not recognized.
It seems that your CentOS is not compatible with one of the libraries snappy requires.
To be more specific GLIBC_2.14 is required by jpy which is needed by snappy.
To overcome this issue you can compile jpy on your own.
This is document on this page.
I tried to fix it but I don’t get it. I downloaded the jpy from GitHub and want to run this code:
How can I find out, which is my os-platform-python-version? I have anaconda (/home/pi/anaconda2/), but I did not find a “build” folder in it, where a folder with “lib-…” exists.
Have you already called
python setup.py --maven build?
This is described in the section Build for Linux / Darwin.
build/lib-<os-platform>-<python-version> should be created when calling this command
Ok, that I did not call. But there I also have an error:
python setup.py --maven build
Error: environment variable “JAVA_HOME must be set to a JDK (>= v1.7) installation directory”.
When searching for it I saw that there is only JDK 1.6 installed. And because I don’t have root permission I could not install a newer version. I will continue to work on it.
How we say it in German:
“Mühsam ernährt sich das Eichhörnchen.”
Which translates to:
“Little by little, the bird builds its nest.”
Hahaha… guter Spruch und er passt dazu!
the admin team of the VM could update the required software for me and I could finally install jpy. But I still have the same error.
[pi@RSS_CloudToolbox bin]$ ./snappy-conf /home/pi/anaconda2/bin/python /home/pi/snappy
java.net.UnknownHostException: RSS_CloudToolbox: RSS_CloudToolbox: unknown error
Caused by: java.net.UnknownHostException: RSS_CloudToolbox: unknown error
at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method)
… 3 more
No protocol specified
Exception: java.lang.NoClassDefFoundError thrown from the UncaughtExceptionHandler in thread “On Start/Stop”
Exception: java.lang.NoClassDefFoundError thrown from the UncaughtExceptionHandler in thread “Folder Instance Processor”
For your information: The
snappyutil.log I found was not in
~/.snap/snap-python but in
~/.snap/snap-python/snappy and when I run the code
./snappy-conf /home/pi/anaconda2/bin/python it does not write anything into the log.
~/.snap/snap-python I only find the file
snappy.properties which contains:
#Created by org.esa.snap.python.PyBridge
#Mon Feb 22 15:45:58 CET 2016
/home/pi/snappy1 does not exist anymore. If I remember right, then it was created the first time I ran
./snappy-conf /home/pi/anaconda2/bin/python /home/pi/snappy1. Should I ask the admins to re-install SNAP?
What else could be the cause?
I proceeded a bit further with the installation of snappy on a CentOS 6.x environment, by compiling separately jpy (it required Oracle Java SDK 1.8).
After the installation, I performed the following test:
>>> from snappy import ProductIO
>>> p = ProductIO.readProduct('/tmp/snappy/testdata/MER_FRS_L1B_SUBSET.dim') java.lang.UnsatisfiedLinkError: no jhdf5 in java.library.path ... WARNING: org.esa.snap.dataio.hdf5.Hdf5ProductWriterPlugIn: class org.esa.snap.dataio.hdf5.Hdf5ProductWriterPlugIn: HDF-5 library not available: class java.lang.NoClassDefFoundError: Could not initialize class ncsa.hdf.hdf5lib.H5
The HDF5 library is available on the system:
ls /usr/lib64/ | grep libhdf5.so libhdf5.so libhdf5.so.6 libhdf5.so.6.0.4 libhdf5.so.7 libhdf5.so.7.0.3
Do you have any hint about that?
Thanks in advance
Maybe the HDF5 libraries are not found from python.
What might work is to edit the
Add the options to the
thanks for the suggestion.
We finally managed to install snappy on CentOS 6.x using the following trick:
ln -s ../amd64/libjhdf.so
ln -s ../amd64/libjhdf5.so
We have also packaged the snappy module as Anaconda package https://anaconda.org/terradue/snappy. It can be installed with:
conda install -c terradue snappy=3.0
It requires java-1.8.0-openjdk-devel and a SNAP installation, of course.
5 posts were split to a new topic: Trouble configuring snappy