Introducing snapista, a GPT wrapper for Python

Hi,

I am starting to work with snapista as I think it is as of now the best way to integrate SNAP and python! @fabricebrito thank you for your contribution.

I am workin on a Windows machine, so I have started installing it within a docker container with:

Everything works fine but here comes my question:

What would be the cleanest solution if I want to include Jupyter Notebook in that docker environment. Modify the dockerfile and rebuild? Install via anaconda modifying the environment.yml?

I guess this can become a recurrent question as so many people uses JN to work. Anyone who has already implemented this could suggest their approach?

Thanks

Hello, I’m happy you enjoy using snapista :slight_smile:
For Jupyter, there’s this approach: GitHub - snap-contrib/docker-snap-jpn-theia: Docker image with Jupyter and Theia IDE providing a playground for SNAP, snappy and snapista. You might want to tailor it to your needs.
I hope this helps

1 Like

Hello, I am very new to SNAP and snapista. I am trying to install snapista in a python environment - python 3.8, but I am getting the following error -

UnsatisfiableError: The following specifications were found to be incompatible with each other:

Output in format: Requested package → Available versionsThe following specifications were found to be incompatible with your system:

  • feature:/linux-64::__glibc==2.35=0
  • feature:|@/linux-64::__glibc==2.35=0

Your installed version is: 2.35

I used conda install -c terradue snapista for installation. Conda version - conda 4.12.0. SNAP version 9.0.0

What could be the solution for this error? Thanks in advance.

Hi,

I’m trying to install snapista on linux without success! I’m using python=3.9, miniconda3:4.10.3 and ubuntu=22.04.
I’m trying to run snapista with the following command: conda install -c terradue snapista and/or conda install -c “terradue/label/dev” snapista and it giving me the following error:

"UnsatisfiableError: The following specifications were found to be incompatible with each other:

Output in format: Requested package → Available versionsThe following specifications were found to be incompatible with your system:

  • feature:/linux-64::__glibc==2.28=0
  • python=3.9 → libgcc-ng[version=‘>=11.2.0’] → __glibc[version=‘>=2.17’]

Your installed version is: 2.28"

Can anyone help me with the snapista installation on linux?

Thanks!

Ola Ana,

Can you try:

conda install -c terradue -c conda-forge snapista

?

Hi Fabrice,

Thank you for your answer! I think its working, but it’s taking a long time, even when I’m using mamba. Do you know why is this happening?

image

@anaferreira97 Try this:

mamba  create -n test
mamba activate test
mamba install -n test -c terradue -c conda-forge python==3.8 snapista 
python -c "import snapista"

It returns:

INFO: org.esa.s2tbx.dataio.gdal.GDALVersion: GDAL 3.0.4 found on system. JNI driver will be used.
INFO: org.esa.s2tbx.dataio.gdal.GDALVersion: Installed GDAL 3.0.4 set to be used by SNAP.
INFO: 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.

I guess the dockerfiles on snap-contrib are getting really old.

Let me know if a local environment works for you and what you plan to do

1 Like

It worked! But when I’m trying to import snapista on a jupyter notebook, it doesn’t recognize the module.

you have to install ipykernel in the environment with:

mamba install -n test -c conda-forge ipykernel

then select the test kernel (maybe reload the window first or tell jupyterlab there’s a new kernel)

The test kernel doesn’t appear to me. I already restart the kernel and still doesn’t recognize snapista.

image

At this stage, it’s no longer related to snapista

Maybe this helps: How to Add a Python 3 Kernel to Jupyter IPython | Saturn Cloud Blog

I got it! Thank you so much for your help Fabrice.