Esa_snappy - No module named 'jpyutil'

I’ve got the esa_snappy module built with SNAP 10 on Windows 11 using python 3.10. I’ve created the PYTHONPATH evironment variable pointing to the esa_snappy installation directory. The command import esa_snappy runs, but returns an error

ModuleNotFoundError                       Traceback (most recent call last)
Cell In[1], line 1
----> 1 import esa_snappy

File ~\.snap\snap-python\esa_snappy\__init__.py:62
     60 if module_dir not in sys.path:
     61     sys.path.append(module_dir)
---> 62 import jpyutil
     64 jpyutil.preload_jvm_dll()
     65 import jpy

ModuleNotFoundError: No module named 'jpyutil'

As per this page I’ve tried to set the LD_LIBRARY_PATH environment variable, but there doesn’t seem to be a file libjvm.so file in the Windows SNAP installation. The closest file I could find was jvm.lib in <SNAP install dir>\jre\lib, so I set LD_LIBRARY_PATH to that. No joy. Any ideas?

This answer could help you

Thanks. Followed that method. Created SNAP_HOME, installed OpenJDK and jpy. Same error.

I tried it again on a different Windows machine. This time I get the same “configuration failed” message from snappy-conf, but import esa_snappy runs fine. All of the test scripts in package tests directory seem to run fine.

For anyone else going through this, the answer was to install both SNAP and Python to paths without spaces, so not …\Program Files\…

The thread linked to by @edd_ss gave the answer, it’s just a few pages deep.

1 Like