Installing SNAPPY with Python 3.11 and jpy release 0.13.0 (Linux), return code 30

I have been trying to install SNAPPY and keep running into problems with my versions of Python and jpy

I can build the jpy wheels from here, no problem. I am using the “release/v0.13.0” branch because the release notes tell me this version works with Python 3.11

I have Python 3.11 installed in a fresh conda environment (SNAPPY_v311). I run
./snappy-conf /home/egreatrix/miniconda3/envs/SNAPPY_v311/bin/python3.11
and I expectantly get an error stating that I don’t have the jpy wheels installed (failed with return code 10).

I get my wheel from home/egreatrix/jpy/dist/*.whl and copy it into /home/egreatrix/.snap/snap-python/snappy.

I run ./snappy-conf /home/egreatrix/miniconda3/envs/SNAPPY_v311/bin/python3.11

This time I get

INFO: Installing from Java module ‘/usr/local/snap/snap/modules/org-esa-snap-snap-python.jar’
WARNING: Architecture requirement possibly not met: Python is x86_64 but JVM requires amd64
INFO: Installing jpy…
INFO: Unzipping ‘/home/egreatrix/.snap/snap-python/snappy/jpy-0.13.0-cp311-cp311-linux_x86_64.whl’
INFO: Configuring jpy…
INFO: jpy Python API configuration written to ‘/home/egreatrix/.snap/snap-python/snappy/jpyconfig.py’
INFO: jpy Java API configuration written to ‘/home/egreatrix/.snap/snap-python/snappy/jpyconfig.properties’
INFO: Configuring snappy…
INFO: snappy configuration written to ‘/home/egreatrix/.snap/snap-python/snappy/snappy.ini’
INFO: Importing snappy for final test…
ERROR: Configuration failed
RuntimeError: jpy: internal error: static method not found: unwrapProxy(Ljava/lang/Object;)Lorg/jpy/PyObject;
~
~
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File “/home/egreatrix/.snap/snap-python/snappy/./snappyutil.py”, line 259, in _main
ret_code = _configure_snappy(snap_home=args.snap_home,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/home/egreatrix/.snap/snap-python/snappy/./snappyutil.py”, line 213, in _configure_snappy
import(‘snappy’)
File “/home/egreatrix/.snap/snap-python/snappy/…/snappy/init.py”, line 235, in
jpy.create_jvm(options=_get_snap_jvm_options())
SystemError: returned a result with an exception set

I have previously fixed this by using python 3.8 and a jpy wheel from here, thanks to @Ferni . However, I was just wondering if anyone had got SNAPPY working in Python 3.11, using jpy wheels from the JPY Consortium repository?

Any other information that may be of use, I have:

  • SNAP Release Version 6
  • jdk-22 (added to path)
  • apache-maven-3.9.6 (added to path)
  • The python install in my conda env SNAPPY_v311 is the first python install in my path
1 Like

I also saw that in SNAPPY GitHub, there is a fix for return code 30.

  • locate libjvm.so
  • Output is, say, /path/to/libjvm.so
  • export LD_LIBRARY_PATH=/path/to/:${LD_LIBRARY_PATH}
  • Re-try the installation

I carried out this fix. However, the error persisted.

1 Like

Is the reason for the issue maybe Java 22?
SNAP and SNAPPY only support Java up to version 11 with the next SNAP 10 release and before only Java 8.

And you say you are still using SNAP 6. Is this correct. Might be time to update, as SNAP 10 is already lurking around the corner.

1 Like

Thanks for the reply, though I have just tried this (added JDK 11 to my path, removed JDK 22 from my path) and the error has persisted. I have also upgraded SNAP from v6 to v9.

I am now trying with Python 3.8, and the jpy wheels 0.16.0, as these wheels are for Python 3.8. The error persists, I have posted the .log below, though it doesn’t give a lot away

INFO: Installing from Java module ‘/opt/snap/snap/modules/org-esa-snap-snap-python.jar’
WARNING: Architecture requirement possibly not met: Python is x86_64 but JVM requires amd64
INFO: Installing jpy…
INFO: Unzipping ‘/home/egreatrix/.snap/snap-python/snappy/jpy-0.16.0-cp38-cp38-linux_x86_64.whl’
INFO: Configuring jpy…
INFO: jpy Python API configuration written to ‘/home/egreatrix/.snap/snap-python/snappy/jpyconfig.py’
INFO: jpy Java API configuration written to ‘/home/egreatrix/.snap/snap-python/snappy/jpyconfig.properties’
INFO: Configuring snappy…
INFO: snappy configuration written to ‘/home/egreatrix/.snap/snap-python/snappy/snappy.ini’
INFO: Importing snappy for final test…
ERROR: Configuration failed with exit code 30

1 Like

Hello! Excuse me, have you found a solution?

no I didn’t. I just went back to my original solution of using python 3.8 and a jpy wheel from here . I have also since upgraded to SNAP V9 (I would use V10, but I need a plugin that is only in V9)

Hi!
As far as I remember I ran into a similar issue with SNAP 9 and Python 3.10. Actually it was possible to install it. To do so you would need to download the jpy as wheel file and feed this into the installer. pip download jpy ( How to use Python's pip to download and keep the zipped files for a package? - Stack Overflow ). I am not 100 % sure the installer just grabbed it from the package cache, otherwise you might have to copy it into the according snappy directory (xxx\resources\lib\jpy_your_wheel_file_name). So far I did not try it for Python 3.11 but possibly I will end up doing so sooner or later, as I ran into a dependency issue with isce3 …
In case you try it let me know if you succeeded.