A error about configuring snappy in python

Help!

I have recently installed SNAP in my windows 10. I installed python 3.6.8 too.

I finish configuring snappy in python. the following error occurs when I run the code about “from snappy import ProductIO”

INFO: org.esa.s2tbx.dataio.gdal.GDALVersion: GDAL not found on system. Internal GDAL 3.0.0 from distribution will be used. (f1)
INFO: org.esa.s2tbx.dataio.gdal.GDALVersion: Internal GDAL 3.0.0 set to be used by SNAP.
Native library load failed.
java.lang.UnsatisfiedLinkError: no gdalalljni in java.library.path
SEVERE: org.esa.s2tbx.dataio.gdal.GDALLoader: Failed to initialize GDAL native drivers. GDAL readers and writers were disabled.java.lang.reflect.InvocationTargetException
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.
INFO: org.esa.s2tbx.dataio.gdal.GDALVersion: Internal GDAL 3.0.0 set to be used by SNAP.
INFO: org.hsqldb.persist.Logger: dataFileCache open start

I installed GDAL3.0.4 and the error still exists.

Maybe you can ignore this or do you use GDAL reader/writers from SNAP? If not you can probably ignore it. The execution of GDAL from Python should still be possible, just the GDAL integration in SNAP would not work.

You could add the path to you GDAL installaion to the PATH environment variable in windows.
Or take a look at the options in SNAP Desktop. There you can configure the which GDAL should be used.

Regarding the actual issue @oana_hogoiu might be able to tell more.

It can’t be solved by other methods. It seems that I can only ignore it. Fortunately, at present, I can get the correct results, despite the existence of this problem.Thank you!

Do your workflows need GDAL? If not, you may be able to ignore the error, but it could be helpful to investigate for the benefit of others who have the same error.

Which installer did you use? Is your SNAP installation fully updated?

Windows systems often end up with multiple GDAL installations. It can be tricky to ensure that there are no conflicts, but the message:

suggests a problem with the installation. Please search for “gdalalljni.dll” in your C:\Users\<userdir>\.snap folder. This should give: C:\Users\<userdir>\.snap\auxdata\gdal\gdal-3-0-0\gdalalljni.dll.

The Windows “Reliability Monitor” may have some information. Some anti-virus or malware blockers may block DLL’s found in “non-standard” locations – this should be mentioned in some log.

I uninstalled GDAL3.0.4 in python,then Gdal was installed by anaconda.
Now It’s working.

1 Like

Excuse me! i cannot understand, can you explain it more detailed
? i have installed GDAL in Anaconda prompt by pip.

You should avoid using pip to install packages in Anaconda python. Use conda or mamba (faster). Note that SNAP 9 provides a recent version of GDAL. Using a “snappy” environment with Anaconda Python 3.8:

(snappy) PS C:\Users\snap\.snap\snap-python> python
Python 3.8.13 | packaged by conda-forge | (default, Mar 25 2022, 05:59:00) [MSC v.1929 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import snappy
INFO: org.esa.s2tbx.dataio.gdal.GDALVersion: Incompatible GDAL 3.5.0 found on system. Internal GDAL 3.2.1 from distribution will be used.
INFO: org.esa.s2tbx.dataio.gdal.GDALVersion: Internal GDAL 3.2.1 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.