Snappy install assistance! macOS venv

I have been trying this for an extremely long period of time. I now have been given a new computer and am trying to start fresh on getting snappy to run on python in a virtual environment. help is very, very appreciated.

I have downloaded SNAP, and I’m on version 12 and selected to configure python as it downloaded. I’m using python 3.9. I would like to note I cannot use anaconda at my institution and am on macOS. I am following instructions listed here.

I have successful installation of the package “/Users/ereilly/snappy/lib/python3.9/site-packages/esa_snappy”

I then run the config file

(snappy) bash-3.2$ /Applications/esa-snap/bin/snappy-conf /Users/ereilly/snappy/bin/python

OpenJDK 64-Bit Server VM warning: Options -Xverify:none and -noverify were deprecated in JDK 13 and will likely be removed in a future release.

Configuring ESA SNAP-Python interface...

Found esa_snappy installed in '/Users/ereilly/snappy/lib/python3.9/site-packages'

Starting configuration...

Configuration finished successful!

Done. The SNAP-Python interface is located in '/Users/ereilly/snappy/lib/python3.9/site-packages/esa_snappy'

The executable of the Python environment is located at '/Users/ereilly/snappy/bin/python'

WARNING: A terminally deprecated method in java.lang.System has been called

WARNING: System::setSecurityManager has been called by org.netbeans.TopSecurityManager (file:/Applications/esa-snap/platform/lib/boot.jar)

WARNING: Please consider reporting this to the maintainers of org.netbeans.TopSecurityManager

WARNING: System::setSecurityManager will be removed in a future release" and this is my output

next, I test it and get errors such as

"

(snappy) bash-3.2$ /Users/ereilly/snappy/bin/python

Python 3.9.0 (v3.9.0:9cf6752276, Oct 5 2020, 11:29:23)

[Clang 6.0 (clang-600.0.57)] on darwin

Type "help", "copyright", "credits" or "license" for more information.

>>> import esa_snappy

fError while parsing JAI registry file "file:/Applications/esa-snap/snap/modules/org.esa.snap.snap-core/org-geotools/gt-coverage.jar!/META-INF/registryFile.jai" :

Error in registry file at line number #31

A descriptor is already registered against the name "org.geotools.ColorReduction" under registry mode "rendered"

Error in registry file at line number #32

A descriptor is already registered against the name "org.geotools.ColorInversion" under registry mode "rendered"

Error while parsing JAI registry file "file:/Applications/esa-snap/snap/modules/org.esa.snap.snap-core/org-jaitools/jt-zonalstats.jar!/META-INF/registryFile.jai" :

Error in registry file at line number #4

A descriptor is already registered against the name "ZonalStats" under registry mode "rendered"

Error while parsing JAI registry file "file:/Applications/esa-snap/snap/modules/org.esa.snap.snap-gpf/org-jaitools/jt-vectorize.jar!/META-INF/registryFile.jai" :

Error in registry file at line number #4

A descriptor is already registered against the name "Vectorize" under registry mode "rendered"

roINFO: org.esa.snap.core.gpf.operators.tooladapter.ToolAdapterIO: Initializing external tool adapters

INFO: org.esa.snap.core.util.EngineVersionCheckActivator: Please check regularly for new updates for the best SNAP experience.

>>> from esa_snappy import ProductIO

>>>

I would like to at the end of the day be able to run scripts using snappy in VS code. Thank you smooch for your time.

@dolaf can you help?

Hello,

your Snappy installation is absolutely ok. The messages you see when importing esa_snappy come from 3rd party modules used by SNAP core, and they are not related to the Snappy functionalities. However, it is not trivial to supress just those messages. We know that this may look a bit confusing, so it is mentioned in the documentation. We’ll try to put even more emphasis on it.

As you see at the end, the import of ProductIO works fine.

Cheers,
Olaf

Hi @dolaf ,

Thank you so much taking the time to respond to me. Potentially it is something wrong with my virtual environment, because I still get “No modeule named ‘snappy’” when I try to run an actual script. I understand this might be out of your purview and apologize for my amateur coding skills!

Hi again,

hmm, the only difference I can see that on your command line you configure SNAP with

/Users/ereilly/snappy/bin/python

Then you correctly call this Python from command line

(snappy) bash-3.2$ /Users/ereilly/snappy/bin/python

Python 3.9.0 (v3.9.0:9cf6752276, Oct 5 2020, 11:29:23)

and snappy works fine.
In your coding IDE, however, your command is

/Users/ereilly/snappy/bin/python3

i.e. ‘python’ vs. ‘python3’.

I don’t know your environment, but maybe that ‘python3’.points to a different Python executable?