Unable to install snappy - jpy problem?

I get this:

   $ export -p | grep JAVA_HOME
    declare -x JAVA_HOME="/Library/Java/JavaVirtualMachines/jdk1.8.0_211.jdk/Contents/Home"

Good, the setting should be visible to python. The next problem to consider is the use of “sudo”, which gives you a different environment. Have you tried your command without “sudo”. Snappy is installed in the user’s ~/.snap directory so sudo should not be used. You may need to reset ownership to yourself in the ~/.snap tree.

I am facing the same issue on my Ubuntu system but I am unable to resolve it using the steps mentioned here. I am attaching the necessary screenshots from my process.
@marpet @jasonbox

jdk

Looking forward.

SNAP provides binary wheels for jpy, but only python 2.7 and a few python 3 versions up to 3.6. You can install Anaconda3’s python 3.6 environment to use an existing binary wheel or try building jpy as described in snappyutil.log with a more recent python.

1 Like

if you can use conda, try:

conda install -n -c terradue jpy

It supports python 3.7, 3.8 and 3.9

2 Likes

Good to know :slight_smile:

Not sure that it’s the right place to put this, but as I spent hours, even days to solve multiple errors that we can find here, let me write this small tutorial from a beginner to beginners.

It’s only useful if you use or want to use the Anaconda distribution, which is highly recommended on Windows. It’s not perfect, but summarise basically what you need to do from scratch until getting SNAP and snappy installed and configured.

1-Download and install Anaconda 3 2020.02 (to get python 3.7 directly)

2-Download and install git

3-Download and install maven

4-Download and install sentinelsat

5-Download and install the latest version of SNAP toolboxes, configure it with the python.exe of Anaconda 3

6-Download and install Visual studio C++ v14 or greater https://visualstudio.microsoft.com/visual-cpp-build-tools/

7-cd to C\user.snap\snap-python\snappy and: git clone https://github.com/bcdev/jpy.git

8-cd to C\user.snap\snap-python\snappy\jpy and: python setup.py bdist_wheel
(if it raises an error such as “JAVA_HOME ext folder exists” then remove the “ext” folder placed where the cmd “echo %JAVA_HOME%” return

9-copy to …snap\snap-python\snappy the .whl file at …snap\snap-python\snappy\jpy\dist

10-cd to C\user.snap\snap-python\snappy and: python setup.py install, then: pip install <.whl file>

11-cd to C:\Program Files\snap\bin and: snappy-conf.bat <path to python.exe of Anaconda 3>

12-copy to Anaconda3\Lib\site-packages\snappy the files at …snap\snap-python\snappy

You’re done!

2 Likes