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:
cd /home/pi/snap/bin
./snappy-conf /home/pi/anaconda2/bin/python
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.
If ~/.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.
e.g.
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:
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.
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.
The directory 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:
cd /home/pi/snap/jpy
export JDK_HOME=
export JAVA_HOME=$JDK_HOME
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.
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]$
[pi@RSS_CloudToolbox bin]$ ./snappy-conf /home/pi/anaconda2/bin/python /home/pi/snappy
java.net.UnknownHostException: RSS_CloudToolbox: RSS_CloudToolbox: unknown error
at java.net.InetAddress.getLocalHost(InetAddress.java:1505)
at org.netbeans.CLIHandler$2.run(CLIHandler.java:667)
at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1423)
at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2033)
Caused by: java.net.UnknownHostException: RSS_CloudToolbox: unknown error
at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method)
at java.net.InetAddress$2.lookupAllHostAddr(InetAddress.java:928)
at java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1323)
at java.net.InetAddress.getLocalHost(InetAddress.java:1500)
… 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”
[pi@RSS_CloudToolbox bin]$
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.
In the ~/.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
snap.pythonExecutable=/home/pi/anaconda2/bin/python
snap.pythonModuleDir=/home/pi/snappy1
The directory /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?
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