Esa-Snappy 10.0.1 conflicts with GDAL 3.6.2

Hello! I’m writing a script in python using snappy but I need GDAL later so I have them imported together:

import esa_snappy
from osgeo import gdal

The funny think is that when I write them that way the error occurs when importing the snappy:

Error while parsing JAI registry file "file:/C:/Program%20Files/esa-snap/snap/modules/ext/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:/C:/Program%20Files/esa-snap/snap/modules/ext/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"
WARNING: org.esa.snap.core.util.ServiceLoader: org.esa.snap.core.gpf.OperatorSpi: Provider eu.esa.opt.meris.sdr.aerosol.AerosolMergerOp$Spi not found
WARNING: org.esa.snap.core.util.ServiceLoader: org.esa.snap.core.gpf.OperatorSpi: Provider eu.esa.opt.meris.sdr.aerosol.ModisAerosolOp$Spi not found
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.esa.snap.runtime.Engine (file:/C:/Program%20Files/esa-snap/microwavetbx/modules/ext/eu.esa.microwavetbx.sar-cloud/org-esa-snap/snap-runtime.jar) to method java.lang.ClassLoader.initializePath(java.lang.String)
WARNING: Please consider reporting this to the maintainers of org.esa.snap.runtime.Engine
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
SLF4J: No SLF4J providers were found.
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See https://www.slf4j.org/codes.html#noProviders for further details.
SLF4J: Class path contains SLF4J bindings targeting slf4j-api versions 1.7.x or earlier.
SLF4J: Ignoring binding found at [jar:file:/C:/Program%20Files/esa-snap/snap/modules/org.esa.snap.snap-netcdf/org-slf4j/slf4j-simple.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Ignoring binding found at [jar:file:/C:/Program%20Files/esa-snap/snap/modules/ext/org.esa.snap.snap-netcdf/org-slf4j/slf4j-simple.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See https://www.slf4j.org/codes.html#ignoredBindings for an explanation.
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.
Traceback (most recent call last):
  File "C:\Users\kinig\miniconda3\envs\NewDayplus\lib\site-packages\osgeo\__init__.py", line 30, in swig_import_helper
    return importlib.import_module(mname)
  File "C:\Users\kinig\miniconda3\envs\NewDayplus\lib\importlib\__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 657, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 556, in module_from_spec
  File "<frozen importlib._bootstrap_external>", line 1166, in create_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
ImportError: DLL load failed while importing _gdal: Δεν ήταν δυνατό να εντοπιστεί η καθορισμένη διαδικασία.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\kinig\Documents\PyCharm\Projects\NewDay\Definitions.py", line 12, in <module>
    from osgeo import gdal
  File "C:\Users\kinig\miniconda3\envs\NewDayplus\lib\site-packages\osgeo\__init__.py", line 46, in <module>
    _gdal = swig_import_helper()
  File "C:\Users\kinig\miniconda3\envs\NewDayplus\lib\site-packages\osgeo\__init__.py", line 42, in swig_import_helper
    raise ImportError(traceback_string + '\n' + msg)
ImportError: Traceback (most recent call last):
  File "C:\Users\kinig\miniconda3\envs\NewDayplus\lib\site-packages\osgeo\__init__.py", line 30, in swig_import_helper
    return importlib.import_module(mname)
  File "C:\Users\kinig\miniconda3\envs\NewDayplus\lib\importlib\__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 657, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 556, in module_from_spec
  File "<frozen importlib._bootstrap_external>", line 1166, in create_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
ImportError: DLL load failed while importing _gdal: Δεν ήταν δυνατό να εντοπιστεί η καθορισμένη διαδικασία.

On Windows, with Python >= 3.8, DLLs are no longer imported from the PATH.
If gdalXXX.dll is in the PATH, then set the USE_PATH_FOR_GDAL_PYTHON=YES environment variable
to feed the PATH into os.add_dll_directory().

Just to be clear, Gdal alone is working fine just like esa_snappy is when imported withoud Gdal.
When I’m writing this way:

from osgeo import gdal
import esa_snappy

it seems to be working, until I try to read the Sentinel-1 file:

s1_img=S1_preprocess(fields,'C:/Users/kinig/Documents/PyCharm/Sat_data/S1A_IW_GRDH_1SDV_20240727T162407_20240727T162432_054949_06B180_D69A.SAFE.zip',debug=True)

File ~\Documents\PyCharm\Projects\NewDay\Definitions.py:295, in S1_preprocess(kml_path, S1_path, to_dB, sp_filter, plot_each, debug)
    293 polarization.append(i.split("_")[-6])
    294 # Read with snappy
--> 295 s1_read = esa_snappy.ProductIO.readProduct(i)
    296 name.append(s1_read.getName())
    297 height.append(s1_read.getSceneRasterHeight())

RuntimeError: java.io.IOException: eu.esa.sar.iogdal.sentinel1.Sentinel1ProductReader
[input=C:\Users\kinig\Documents\PyCharm\Sat_data\S1A_IW_GRDH_1SDV_20240727T162407_20240727T162432_054949_06B180_D69A.SAFE.zip]:
'int org.gdal.gdalconst.gdalconstJNI.GDT_Unknown_get()'

I’m working with snappy for months and now its the only time it refuses to work…

I just managed to fix it. I just upgraded the gdal through the conda terminal to the latest 3.9.2.