Install snappy on Google Colab error

I’m trying to install the snappy on Google Colab but I’m getting error during ProductIO import.
I used the following code:
! pip install snappy
!sudo apt-get install libsnappy-dev

!pip3 install python-snappy.

import snappy do not rise error but for
from snappy import jpy, GPF, HashMap, File
I get
ImportError Traceback (most recent call last)
in ()
----> 1 from snappy import jpy, GPF, HashMap, File

ImportError: cannot import name ‘jpy’

There are several different Python projects called “snappy”. I don’t think you can install the ESA SNAP snappy using pip, so you likely got some unexpected “snappy”.

If you are familiar with ESA SNAP, you already know ESA SNAP snappy requires an installation of ESA SNAP, which is a Java application. When you install SNAP you can ask to have snappy configured and supply the path to the python interpreter you want to use. “jpy” is a bidirectional interface between Java and Python. SNAP provides prebuilt Python wheels for various platforms and Python versions.

There has been interest in a “headless” command-line installation – maybe someone else has that working by now.

Colab FAQ says"Users with high computational needs may be interested in using Colab’s UI with a local runtime running on their own hardware."


Hi, I usually use snappy on google colab. It used to work fine via miniconda, but the last few days I’ve been having problems. Now when I import the libraries, python can’t find jpy even though it is installed. Is anyone else having this problem?

It’s great to see the clarification regarding the different ‘snappy’ projects in Python. You’re absolutely right; the ESA SNAP ‘snappy’ is an integral part of the ESA SNAP (Sentinel Application Platform), and it requires the installation of SNAP, which is a Java application. The seamless interaction between Java and Python facilitated by ‘jpy’ is truly remarkable.

For those exploring high computational needs, the mention of a ‘headless’ command-line installation is intriguing. It would be fantastic if someone has already made progress in this area, as it could streamline certain workflows.

I also appreciate the reference to Colab’s local runtime for users with substantial computational demands. This option provides flexibility and scalability, allowing users to leverage their own hardware resources effectively.

Thank you for sharing these insights and helping to clarify the nuances of Python ‘snappy’ projects and the options available in different contexts."

Advertisement deleted from @stevediaz 's post and account silenced for 5 days.