Error while configuring esa-snappy with Python 3.9.13 on Windows 11 - Configuration Failed - No Error Code

Hi everyone. I’m having issues when trying to configure SNAP 10 with Python 3.9.13 on Windows 11 (version 23H2). The text from the cmd is shown below:

Microsoft Windows [Version 10.0.22631.3447]
(c) Microsoft Corporation. All rights reserved.

C:\Users\user>cd C:\Program Files\esa-snap

C:\Program Files\esa-snap>snappy-conf C:\Users\user\AppData\Local\Programs\Python\Python39\python.exe

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.
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.netbeans.ProxyURLStreamHandlerFactory (file:/C:/Program%20Files/esa-snap/platform/lib/boot.jar) to field java.net.URL.handler
WARNING: Please consider reporting this to the maintainers of org.netbeans.ProxyURLStreamHandlerFactory
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
Configuring ESA SNAP-Python interface...
Configuration failed!
Error: Python configuration error
Full stack trace:

C:\Program Files\esa-snap>

Two things to note: I’m not getting an error code, and the full stack trace is blank. Both of these made it very difficult for me to know how to fix this. I also couldn’t find any previous post that discussed this issue.

I’ve tried reinstalling both SNAP and Python, but it didn’t help.

Some additional information:

  • I don’t have other versions of Python nor SNAP installed.
  • I have 16 GB RAM so I’m running on a 64-bit OS.
  • The installed Python and SNAP are both 64-bit versions.
  • I’ve checked that the Python path is in the environment variables.
  • I’m running the cmd or the SNAP command line “as administrator”

This is my first post on this forum. I’ve tried to read the guidelines and include all (hopefully) relevant information, but please let me know if I forgot to mention anything.

1 Like

same problem here. Any hints?

@dolaf could you have a look? Thanks

Dear Users,

thanks for reporting this. We reproduced the problem on Windows 11 with Python versions >= 3.8, including the 3.9.13 you are using. It seems that the problem is Win11-specific, as on Windows 10 esa_snappy obviously works without problems for Python versions up to 3.10 as it should.

We will further investigate the issue. For the moment we can only recommend to use Python max. 3.7.x if on Win11, or to move to Win10 if possible. We are sorry for the inconvenience.

Olaf

@dolaf @diana_harosa Let’s gather all know issues on the release notes page:

https://step.esa.int/main/wp-content/releasenotes/SNAP/SNAP_10.0.0.html

I actually managed to solve the issue and get snappy running.

I used:

  1. I installed Apache Maven (from here https://maven.apache.org/) and set its path environment variable (see Maven – Installing Apache Maven)
  2. I installed JDK (from here Java Downloads | Oracle or from here OpenJDK JDK 22.0.1 GA Release) and set the environmental system variables “JAVA_HOME” to “C:\jdk-22.0.1” and added “C:\jdk-22.0.1\bin” to the Path variable
  3. I installed the windows SDK (from here Windows SDK - Windows app development | Microsoft Developer). Make sure, it is is added to the Path system variable.
  4. I installed Python. Make sure, it is is added to the Path system variable.
  5. I installed Spyder and chose my Python10 as interpreter
  6. I installed Snap and ticked the box for automatic config to be used with Python and put in “C:\python3.10.11\python.exe”
  7. I installed Snappy by following the steps from https://senbox.atlassian.net/wiki/spaces/SNAP/pages/2499051521/Configure+Python+to+use+the+new+SNAP-Python+esa+snappy+interface+SNAP+version+10

I put SNAP, Python, the JDK and Maven into the root C:\ folder to avoid blank spaces (such as in “Program Files”) in paths. Maybe it is not important.

I hope that helps (took me several days)!

2 Likes

Hi, congratulations and thanks a lot for sharing this. However, this procedure is way too complicated. In the end, installation should be as simple as we described for Win10. As said, we’ll work on this issue and check for incompatibilities.

2 Likes

Hi again, I had a closer look, and there might be a simple solution:

I noticed that during the first test run, as reported two days ago, I had (by accident) environment variables PYTHONHOME and PYTHONPATH pointing to a Python version different to the one I was trying to use with esa_snappy. Given this, I got exactly the same error as you did, with empty stack trace from snappy-conf. So perhaps the same applies on your side?

After removing PYTHONHOME and PYTHONPATH, everything is now working fine. It is ok, however, if the Python you are using for esa_snappy is on the standard ‘Path’ variable. It is also ok if you have other Pythons installed on your system, but don’t use them in any environment variables.

I tested for Python versions:

  • Miniconda distributions 3.10.14, 3.9.19, 3.8.18, 3.7.13

  • python.org: 3.10.11, 3.9.13

The test environment is Windows 11 Pro (Version 23H2, Build 22631.3447), with SNAP 10 installed from the latest installer available on step.esa.int.

I hope the fix will work for you as well. In any case, we will add the experience to the installation guideline page.

Cheers,
Olaf

I am getting the failure to configure error when running snap-conf.

When I copy the esa_snappy folder into the python environment site-packages folder and try to import esa_snappy, the jpyutil file fails to load. I actually can’t find the jpyutil.py file anywhere on my computer. Does this mean the installation is incomplete?

I’m running Win 10. I don’t have PYTHONHOME or PYTHONPATH at all. I’ve also taken all Python references out of my PATH variable. I am running the above command in a conda environment which worked fine for Snap 9

Hi, I’m using Python 3.10.13 in anaconda environment (windows 11). When installing SNAP, i tickled the box for autmatic config. But I still cannot use the snappy library. Please help me, I am really new to this

C:\Program Files\esa-snap\bin>snappy-conf C:\Users\niput\anaconda3\envs\snapenv\python.exe


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.
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.netbeans.ProxyURLStreamHandlerFactory (file:/C:/Program%20Files/esa-snap/platform/lib/boot.jar) to field java.net.URL.handler
WARNING: Please consider reporting this to the maintainers of org.netbeans.ProxyURLStreamHandlerFactory
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release

The result is just end on that.

I have tried it many times, but still same.

1 Like

Hello to everyone. I’ve got problem on the configuration of esa-snappy for Python. First of all, during the installation of SNAP software I enable Python for SNAP, I indicate the correct path for the python.exe to use, but it seems like this operation doesn’t happen.
I tried from cmd, following all the instructions and the advices from this forum, and @dolaf I didn’t understood at all what do you mean with environment variables PYTHONHOME and PYTHONPATH. May I have more clarifications on your last comment, please? (Keep in mind that I need very “naive” explanations, if it’s not a problem for you. I thank you very much in advance for your help)

On a Windows 10 platform, type Environment in the start menu and choose:
image
Then,
image
Then, remove this variable, and PYTHONPATH if they exist
image

These variables are sometimes automatically added by programs that like to use them. Many programs look for this variable and will use the python version it points to, but this creates a lot of problems on a Windows platform that has a lot of different Python installations.

Ok, I have esa_snappy working with Python 3.10 Anaconda environment with Windows 10. There were three steps I was missing.

  1. I needed to install jpy in my python environment with this command, pip install jpy
  2. I needed to install a Java Development Kit, but not the newest one (22). I installed OpenJDK 11.
  3. And I needed to create a SNAP_HOME environment variable that points to the install directory of Snap. On my machine it’s here,
    image

It would be nice to have these steps mentioned in the docs for setting up esa_snappy to work with Snap 10. It’s great to have the functionality of Python working with Snap available!

Hi cndnflyr,

good to hear you got it running. However, all these steps should no longer be necessary with esa_snappy in SNAP 10 (no manual jpy installation, no additional JDK etc). We spent quite a bit of time to get rid of all this from SNAP 10 onwards.

Therefore, a few comments which might help to solve also your original problem:

Your previous post: yes, the installation looks incomplete. After a successful installation, jpyutil.py should be in the esa_snappy folder:

I understand that your setup is Win10 and Python3.10 with a virtual env ‘esa_snappy_310’ in which you want to have esa_snappy installed in the corresponding site-packages folder (instead of the default folder .snap\snap-python).

I set up an equivalent Windows 10 test scenario on my side:

  • installed SNAP 10 from latest installer

  • installed Miniconda Python3.10

  • created a virtual environment:
    D:\olaf\miniconda3_py310\condabin> conda.bat create -n env_test_esa_snappy python=3.10
    (note that the Python version must be specified, otherwise the latest version 3.12 would be installed, which is not (yet) supported by esa_snappy)
    D:\olaf\miniconda3_py310\condabin> conda.bat activate env_test_esa_snappy

  • run snappy-conf:
    (env_test_esa_snappy) D:\olaf\bc\snap-snapshots\10\10.0-release\snap\bin> snappy-conf.bat "D:\olaf\miniconda3_py310\envs\env_test_esa_snappy\python.exe" "D:\olaf\miniconda3_py310\envs\env_test_esa_snappy\Lib\site-packages"

  • test:
    (env_test_esa_snappy) D:\olaf> python
    Python 3.10.14 | packaged by Anaconda, Inc. | (main, Mar 21 2024, 16:20:14) [MSC v.1916 64 bit (AMD64)] on win32
    Type “help”, “copyright”, “credits” or “license” for more information.
    > import esa_snappy

→ works all fine

I’m not sure if this helps for you, as it seems that you basically tried the same. Are your ‘base’ Python and the ‘esa_snappy_310’ Python both 3.10 (although I don’t know if this makes a difference)? If nothing helps, I suggest that you reinstall everything following the steps as listed above. Also make sure that you clean relevant folders, such as the esa_snappy target, from (incomplete) content of previous unsuccessful tries.

Btw., thanks for posting the PYTHONPATH/PYTHONHOME explanations!

Cheers,
Olaf

1 Like

Dear User risma,

your log messages are incomplete, but do not show any errors. We noticed that sometimes the snappy-conf log messages are incomplete like this, or the command prompt does not come back, although the installation was successful in background. The reason for this behaviour needs to be investigated. The full set of log messages for a successful installation should look as shown below:

Therefore, could you please check if the folder [your homedir]\.snappy\snap-python\esa_snappy exists, and if you can import esa_snappy in your Python called with C\Users\niput\anaconda3\envs\snapenv\python.exe ?

Thanks a lot,
Olaf

@dolaf I followed all the steps reported. I ensured to remove PYTHONHOME and PYTHONPATH (they were not already inserted), and I ensured to have .snap/snap-python. Following all the steps you mention here

I still have the incomplete processing message occurred to the other users.
How can we solve?

EDIT:
I found a way to make it work, but when I import esa_snappy I have the error “can’t find any JVM shared library”.
What does it mean?

There must be something in my environment that (and others) that is throwing off the install. I cleaned out everything I can find. User Path, System PATH env variables, snap folders in Program Files, folders in User directory, removed past environments in conda and miniforge. etc…

I downloaded a new install file, this time ALL toolboxes rather than just sentinel. I get this window still, so there must be something it’s finding that I’m not aware of.
image

I checked the “Configure SNAP for use with Python” but left the Python executable path blank during installation. Different than I usually do.

I also left the “Extend my PATH environment variable” even though I usually uncheck it.

I tried a new installation of Anaconda with a new environment there as well. But my result stays the same,

I have two desktops that I have tried the same steps with and get the same results.

You’ve given me the confidence that this process should work, but there is a disconnect somewhere in the installation, and snappy-conf.bat fails, not due to Windows Environment Variables it seems.

1 Like