Dear all,
I’ve been trying to use snap with python 3.9.12 in Jupyter notebook. Tried using python 3.4 and all excercise went in vain. After a week’s futile exercise. Now again installed python 3.9.12 and while trying this, the error is like this in SNAP command line:
snappy-conf C:\Users\HP\anaconda3\envs\snap\python.exe C:\Users\HP\anaconda3\envs\snap\Lib\site-packages
The launcher has determined that the parent process has a console and will reuse it for its own console output.
Closing the console will result in termination of the running program.
Use ‘–console suppress’ to suppress console output.
Use ‘–console new’ to create a separate console window.
OpenJDK 64-Bit Server VM warning: ignoring option MaxPermSize=384m; support was removed in 8.0
Python configuration internal error: org/esa/snap/core/util/Debug
Please suggest, why there is a confusion while installing snap and configuring snappy? Although, I installed snap this time in the same environment, I created in anaconda.
I have run into similar problems, and although I have successfully integrated snappy with Python 3.9, I had trouble repeating it when the environment got more complicated. I suggest you use Anaconda to install python 3.6 in the environment and run it from there. This will simplify a lot of things for you.
If you really need Python 3.9, consider using the python library “subprocess” to run a separate python script in 3.6, just for the snappy processing.
The launcher has determined that the parent process has a console and will reuse it for its own console output.
Closing the console will result in termination of the running program.
Use ‘–console suppress’ to suppress console output.
Use ‘–console new’ to create a separate console window.
OpenJDK 64-Bit Server VM warning: ignoring option MaxPermSize=384m; support was removed in 8.0
Python configuration error: Python configuration failed.
Command [C:\Users\HP\Anaconda3\python.exe .\snappyutil.py --snap_home “C:\Program Files\snap” --java_module “C:\Program Files\snap\snap\modules\org-esa-snap-snap-python.jar” --force --log_file .\snappyutil.log --jvm_max_mem 5G --java_home “C:\Program Files\snap\jre\jre” --req_arch amd64]
failed with return code 1.
Please check the log file ‘C:\Users\HP.snap\snap-python\snappy\snappyutil.log’.
Now 8 days are gone doing exclusively this exercise. I’ll really appreciate if some friend configure snappy for me through screen sharing mode. And I need to use the configuration in Google Colab.
Snappy util.log file says:
INFO: Installing from Java module ‘C:\Program Files\snap\snap\modules\org-esa-snap-snap-python.jar’
INFO: Installing jpy…
INFO: Extracting ‘lib/jpy-0.9.0-cp36-cp36m-win_amd64.whl’ from ‘C:\Program Files\snap\snap\modules\org-esa-snap-snap-python.jar’
INFO: Unzipping ‘C:\Users\HP.snap\snap-python\snappy\lib\jpy-0.9.0-cp36-cp36m-win_amd64.whl’
INFO: Configuring jpy…
INFO: jpy Python API configuration written to ‘C:\Users\HP.snap\snap-python\snappy\jpyconfig.py’
INFO: jpy Java API configuration written to ‘C:\Users\HP.snap\snap-python\snappy\jpyconfig.properties’
INFO: Configuring snappy…
INFO: snappy configuration written to ‘C:\Users\HP.snap\snap-python\snappy\snappy.ini’
INFO: Importing snappy for final test…
Perhaps the dependency file for jvm.dll. But I don’t know about it.
I installed python3.6.8 through python installer in Drive C.
snappyutil.log file says as below:
INFO: Installing from Java module ‘C:\Program Files\snap\snap\modules\org-esa-snap-snap-python.jar’
INFO: Installing jpy…
INFO: Extracting ‘lib/jpy-0.9.0-cp36-cp36m-win_amd64.whl’ from ‘C:\Program Files\snap\snap\modules\org-esa-snap-snap-python.jar’
INFO: Unzipping ‘C:\Python\Python36\Lib\site-packages\snappy\lib\jpy-0.9.0-cp36-cp36m-win_amd64.whl’
INFO: Configuring jpy…
INFO: jpy Python API configuration written to ‘C:\Python\Python36\Lib\site-packages\snappy\jpyconfig.py’
INFO: jpy Java API configuration written to ‘C:\Python\Python36\Lib\site-packages\snappy\jpyconfig.properties’
INFO: Configuring snappy…
INFO: snappy configuration written to ‘C:\Python\Python36\Lib\site-packages\snappy\snappy.ini’
INFO: Importing snappy for final test…
ERROR: Configuration failed with exit code 30
The “final test” that failed attempts to load [ESA]snappy. In a terminal, run your python3.6 and try import snap. This should give details of the error.
Hello everyone,
I have spent several days to be able to install snappy. So, I thought it would be useful to write down the procedure that I followed. I tried to create a new topic in the forum entitled “Snappy Installation in Ubuntu” , but I couldn’t - probably because of my membership limitations. If the forum admins could move this post to a new topic or let me know how to do it, it would be great. Also, any suggestions/edits would be appreciated.
To install snappy in ubuntu 22.04, Anaconda 3 for python 3.9 I did the following steps:
• If you don’t have python installed, the first step is to install python – as mentioned above, I had installed Anaconda 3 – python3.9.
• Next, make sure you have java installed as well. It is recommended to install JDK 8 with oracle distribution. you can search the instructions and where you can find the archived versions.
Please note that even if you have openjdk installed, you may still have to install JDK 8 with oracle distribution and prioritize it.
• Then, run the sudo vim ~/.profile or sudo vim ~/.bashrc (depending on your system), and edit the path for JDK_HOME and JAVA_HOME as follows- you could do this step after snap installation:
export JDK_HOME=/usr/lib/jvm/jdk1.8.0_333 #this is an example path
export JAVA_HOME=$JDK_HOME
• Then, install maven for ubuntu.
• Next, you need to install snap. For doing so, download the unix .sh file for the current snap version, cd to where you downloaded the file, and run:
sudo chmod +x esa-snap_sentinel_unix_5_0.sh
./esa-snap_sentinel_unix_5_0.sh
• Then, run the following commands (documentation can be found in github under jpy-consortium):
git clone “jpy-consortium https link”
cd jpy
python setup.py build maven bdist_wheel
cp dist/*.whl “/root/.snap/snap-python/snappy”
If you encountered the error: Error: environment variable “JAVA_HOME” must be set to a JDK (>= v1.7) installation directory It means that you have not set the JDK_HOME and JAVA_HOME, or have not done this correctly. Note that the Java home should include “include” and “lib” directories.
• Afterwards, you should configure python for snappy:
cd “snap installation directory”/bin
./snappy-conf “python executable”
If the configuration fails with code 10, it means that you have not configured jpy correctly, or you have not copied the wheel to the snappy directory.
If the configuration fails with code 30, the version of the copied wheel is not compatible with the python version. In this case, you could find ideas how to fix it by searching in this forum . In shorts, you have to download another wheel which is compatible with your python version, and copy it to the snappy folder.
• The final step is to open python and run the following commands to check if snappy is up and running:
import sys
sys.path.append(’/home/sahel/.snap/snap-python/snappy/’)
from snappy import ProductIO
if you encountered error, make sure you have specified the installation directory correctly, and make sure conda has not confused snappy with another package with the same name.
if these lines run smoothly, you are good to go!
Using sys.path.append puts the ESA SNAP snappy directory at the tail end of the python path. If you have installed another package called snappy you should use `sys.path.insert(1,<ESA_SNAP_snappy_dir>)’ (this leaves the first entry as the directory where you ran the python command).
Note that other tools may stop working with JDK_HOME or JAVA_HOME set to Java 8. In such cases, “environment module” can be used to adjust environment settings from the command-line.