I am having enormous trouble being able to use the snappy package in python. I am using Windows 10, 64-bit, anaconda3, python version 3.5.5
What I type in to test the installation is
from snappy import ProductIO
The error I get is:
ImportError: cannot import name ‘ProductIO’
Steps I’ve tried to install snappy:
-
I’ve installed SNAP 6.0.0, used the checkbox to sync my SNAP with my python at the directory C:/Users/…/Anaconda3/python.exe
-
I’ve followed the instructions on
https://senbox.atlassian.net/wiki/spaces/SNAP/pages/50855941/Configure+Python+to+use+the+SNAP-Python+snappy+interface
-
Instructions here
https://forum.step.esa.int/t/jpy-python-java-bridge-version/329/3
-
instructions here
https://github.com/bcdev/jpy
for windows install of jpy. Wheel was successfully made. -
the instructions here
https://forum.step.esa.int/t/snappy-error-config-installation/8314/10
for this one, I was able to follow along with all of his steps successfully, but I am unable to
import jpy
from my python shell in windows cmd. Everything else was exactly as his output photos show.
Below is my snappyutil.txt document:
INFO: Installing from Java module ‘C:\Program Files\snap\snap\modules\org-esa-snap-snap-python.jar’
INFO: Installing jpy…
INFO: Unzipping ‘C:\Users\Radiant Solutions.snap\snap-python\snappy\jpy-0.9.0-cp35-cp35m-win_amd64.whl’
INFO: Configuring jpy…
INFO: jpy Python API configuration written to ‘C:\Users\Radiant Solutions.snap\snap-python\snappy\jpyconfig.py’
INFO: jpy Java API configuration written to ‘C:\Users\Radiant Solutions.snap\snap-python\snappy\jpyconfig.properties’
INFO: Configuring snappy…
INFO: snappy configuration written to ‘C:\Users\Radiant Solutions.snap\snap-python\snappy\snappy.ini’
INFO: Importing snappy for final test…
INFO: Done. The SNAP-Python interface is located in ‘C:\Users\Radiant Solutions.snap\snap-python\snappy’
When using SNAP from Python, either do: sys.path.append(‘C:\Users\Radiant Solutions\.snap\snap-python\snappy’)
or copy the snappy module into your Python’s ‘site-packages’ directory.
When I run
import snappy
dir(snappy)
I get the output:
['StreamCompressor', 'StreamDecompressor', 'UncompressError', '__builtins__', '__cached__', '__doc__', '__file__', '__loader__', '__name__', '__package__', '__path__', '__spec__', '_snappy', 'compress', 'decompress', 'hadoop_snappy', 'hadoop_stream_compress', 'hadoop_stream_decompress', 'isValidCompressed', 'snappy', 'stream_compress', 'stream_decompress', 'uncompress']
It’s not showing ProductIO, jpy, or anything like that.
I’m at a loss for how to get this to work. If anyone knows how I can fix this and use snappy in python, that would be greatly appreciated.
I also need to get it installed and working on a jupyter notebook.