The error about snappy installation

I’ve tried every step for solving this problem, but the error code 30 still exists.
I don’t know why, who can help me to solve this error? (SNAP 9.0 + Python 3.6.13)

THE ERROR:

PS I:\snap\bin> snappy-conf I:\Anaconda\envs\snap\python.exe I:\Anaconda\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
Configuring SNAP-Python interface…
java.io.IOException: Python configuration failed.
Command [I:\Anaconda\envs\snap\python.exe .\snappyutil.py --snap_home I:\snap --java_module I:\snap\snap\modules\org-esa-snap-snap-python.jar --force --log_file .\snappyutil.log --jvm_max_mem 22G --java_home I:\snap\jre\jre --req_arch amd64]
failed with return code 30.
Please check the log file ‘I:\Anaconda\envs\snap\Lib\site-packages\snappy\snappyutil.log’.
at org.esa.snap.python.PyBridge.configureJpy(PyBridge.java:232)
at org.esa.snap.python.PyBridge.installPythonModule(PyBridge.java:149)
at org.esa.snap.rcp.cli.SnapArgsProcessor.processPython(SnapArgsProcessor.java:103)
at org.esa.snap.rcp.cli.SnapArgsProcessor.process(SnapArgsProcessor.java:49)
at org.netbeans.modules.sendopts.DefaultProcessor.process(DefaultProcessor.java:202)
at org.netbeans.spi.sendopts.Option$1.process(Option.java:387)
at org.netbeans.api.sendopts.CommandLine.process(CommandLine.java:317)
at org.netbeans.modules.sendopts.HandlerImpl.execute(HandlerImpl.java:62)
at org.netbeans.modules.sendopts.Handler.cli(Handler.java:69)
at org.netbeans.CLIHandler.notifyHandlers(CLIHandler.java:234)
at org.netbeans.core.startup.CLICoreBridge.cli(CLICoreBridge.java:82)
at org.netbeans.CLIHandler.notifyHandlers(CLIHandler.java:234)
at org.netbeans.CLIHandler$1.exec(CLIHandler.java:268)
at org.netbeans.CLIHandler.finishInitialization(CLIHandler.java:447)
at org.netbeans.MainImpl.finishInitialization(MainImpl.java:256)
at org.netbeans.Main.finishInitialization(Main.java:92)
at org.netbeans.core.startup.Main.start(Main.java:316)
at org.netbeans.core.startup.TopThreadGroup.run(TopThreadGroup.java:123)
at java.lang.Thread.run(Thread.java:748)
Python configuration error: Python configuration failed.
Command [I:\Anaconda\envs\snap\python.exe .\snappyutil.py --snap_home I:\snap --java_module I:\snap\snap\modules\org-esa-snap-snap-python.jar --force --log_file .\snappyutil.log --jvm_max_mem 22G --java_home I:\snap\jre\jre --req_arch amd64]
failed with return code 30.
Please check the log file ‘I:\Anaconda\envs\snap\Lib\site-packages\snappy\snappyutil.log’.
PS I:\snap\bin>

Maybe @dolaf could help you.

Hi Ralph,

the observed error code 30 can have various reasons:

  1. Did you check the log file snappyutil.log for further information, as stated in your error message?
  2. As next try, you should check your Python environment:
  • if set, your ‘standard’ Python (the first found on your path) should not be different from the one in your snappy-conf call. In your case, your ‘standard’ Python (if added to the path for the session or permanently) should be I:\Anaconda\envs\snap\python.exe

  • in the same way, any Python-related environment variables (if existing), such as PYTHONHOME or PYTHONPATH, should not point to a different Python either.

I hope this helps.

Apart from this, the ‘snappy’ interface in SNAP <= 9 has limitations. Thus, the new SNAP 10, to be released in very near future, will come with a revised implementation.

Cheers,
Olaf

Thank you for your help. :grin:

This is the information in the log file snappyutil.log:

INFO: Installing from Java module ‘I:\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 ‘I:\snap\snap\modules\org-esa-snap-snap-python.jar’
INFO: Unzipping ‘I:\Anaconda\envs\snap\Lib\site-packages\snappy\lib\jpy-0.9.0-cp36-cp36m-win_amd64.whl’
INFO: Configuring jpy…
INFO: jpy Python API configuration written to ‘I:\Anaconda\envs\snap\Lib\site-packages\snappy\jpyconfig.py’
INFO: jpy Java API configuration written to ‘I:\Anaconda\envs\snap\Lib\site-packages\snappy\jpyconfig.properties’
INFO: Configuring snappy…
INFO: snappy configuration written to ‘I:\Anaconda\envs\snap\Lib\site-packages\snappy\snappy.ini’
INFO: Importing snappy for final test…
ERROR: Configuration failed with exit code 30

And I did not set any envorinment variable about Python. I will try to set the PYTHONHOME and PYTHONPATH in the envorinment variable and reinstall snappy.

I add ‘I:\Anaconda\envs\snap\python.exe’ to Path in the environment variable.

I tried set the PYTHONHOME and PYTHONPATH which was unsuccessful but also I couldn’t use my ‘conda’. So I delete my set.

And after I did the above, the error still exists.

INFO: Installing from Java module ‘I:\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 ‘I:\snap\snap\modules\org-esa-snap-snap-python.jar’
INFO: Unzipping ‘I:\Anaconda\envs\snap\Lib\site-packages\snappy\lib\jpy-0.9.0-cp36-cp36m-win_amd64.whl’
INFO: Configuring jpy…
INFO: jpy Python API configuration written to ‘I:\Anaconda\envs\snap\Lib\site-packages\snappy\jpyconfig.py’
INFO: jpy Java API configuration written to ‘I:\Anaconda\envs\snap\Lib\site-packages\snappy\jpyconfig.properties’
INFO: Configuring snappy…
INFO: snappy configuration written to ‘I:\Anaconda\envs\snap\Lib\site-packages\snappy\snappy.ini’
INFO: Importing snappy for final test…
ERROR: Configuration failed with exit code 30

Hi,

I tried to set up an environment similar to yours:

After installation I did in a cmd in SNAP bin folder:
.\snappy-conf D:\olaf\miniconda3_py36\python.exe
→ snappy is being installed successfully.

Then I added a test environment to the py36:
D:\olaf\miniconda3_py36\Scripts\conda.exe create -n test_env python=3.6.5 matplotlib

and after that I did the snappy configuration again:
.\snappy-conf D:\olaf\miniconda3_py36\envs\test_env\python.exe
→ snappy is again being installed successfully.

I do not have any PYTHONHOME or PYTHONPATH set, and my Path variable is not even ‘clean’, as it contains an entry to another existing Python 3.10 installation. Thus, something else must be screwed up in your setup.

Next I recommend:

  1. If not already done, install the latest updates in your SNAP 9 installation (always a good idea)

  2. Delete the contents of your snappy installation dir (default is $HOME\ .snap\snap-python) before your next try. Maybe something is corrupt in there. After a successful installation, the $HOME\ .snap\snap-python\snappy folder should look like this:

If none of this helps, reinstall the Python 3.6?

Cheers,
Olaf

Hi,

I tried your recommendation above, but they didn’t work.

First I set a Python 3.6.13 virtual environment by Anaconda. Then I install SNAP and the latest updates in my SNAP 9, and I didn’t choose the Python path when I install. Finally I use SNAP Command-Line to install snappy, and I install snappy in the virtual environment which I set above.

Unfortunately, it doesn’t work.

Cheers,
Ralph

Hi Ralph,

as a final test, I even mapped your Python minor version and installed another env with Python 3.6.13:
D:\olaf>D:\olaf\miniconda3_py36\Scripts\conda.exe create -n env_3_6_13 python=3.6.13 scipy

Again, the snappy configuration
D:\olaf\bc\snap-snapshots\9\9.0-release\snap\bin>.\snappy-conf.bat D:\olaf\miniconda3_py36\envs\env_3_6_13\python.exe
is successful for this. Thus, the snappy support in SNAP 9 basically works correctly for this Python.

I think this is all I can do from remote for the moment. I suggest that you a) reinstall everything (SNAP, Python), or b) try on a different computer, or c) if possible for you, wait for SNAP 10 which is very close to be released.

Cheers,
Olaf