<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>ok, so now you have to inspect the PATH and fix it so that the
      gdal DLL and its dependencies are in it. But all of this sounds
      like there's something weird in your environment. Perhaps a mix of
      GDAL versions?<br>
    </p>
    <div class="moz-cite-prefix">Le 13/10/2021 à 15:36, Pedro Venâncio a
      écrit :<br>
    </div>
    <blockquote type="cite"
cite="mid:CAMCJChvgyTPt=G9SXxyS-rP3d8hGBoC5Hik+OuPQ1k5V2bMc_w@mail.gmail.com">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <div dir="ltr">
        <div class="gmail_quote">
          <blockquote class="gmail_quote" style="margin:0px 0px 0px
            0.8ex;border-left:1px solid
            rgb(204,204,204);padding-left:1ex">
            <div>
              <p>Can you change in __init__.py<br>
              </p>
              <p>                try:<br>
                                    os.add_dll_directory(p)<br>
                                except FileNotFoundError:<br>
                                    continue</p>
              <p><br>
              </p>
              <p>to</p>
              <p>                try:<br>
                                    os.add_dll_directory(p)<br>
                                except (FileNotFoundError, OSError):<br>
                                    continue</p>
            </div>
          </blockquote>
          <div><br>
          </div>
          <div>Yes, here is the output:<br>
          </div>
          <div>
            <pre class="gmail-code gmail-highlight" lang="plaintext"><span id="gmail-LC1" class="gmail-line" lang="plaintext">Traceback (most recent call last):</span>
<span id="gmail-LC2" class="gmail-line" lang="plaintext">  File "C:\Users\PedroVenancio\anaconda3\envs\arosics\lib\site-packages\osgeo\__init__.py", line 21, in swig_import_helper</span>
<span id="gmail-LC3" class="gmail-line" lang="plaintext">    return importlib.import_module(mname)</span>
<span id="gmail-LC4" class="gmail-line" lang="plaintext">  File "C:\Users\PedroVenancio\anaconda3\envs\arosics\lib\importlib\__init__.py", line 127, in import_module</span>
<span id="gmail-LC5" class="gmail-line" lang="plaintext">    return _bootstrap._gcd_import(name[level:], package, level)</span>
<span id="gmail-LC6" class="gmail-line" lang="plaintext">  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import</span>
<span id="gmail-LC7" class="gmail-line" lang="plaintext">  File "<frozen importlib._bootstrap>", line 991, in _find_and_load</span>
<span id="gmail-LC8" class="gmail-line" lang="plaintext">  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked</span>
<span id="gmail-LC9" class="gmail-line" lang="plaintext">  File "<frozen importlib._bootstrap>", line 657, in _load_unlocked</span>
<span id="gmail-LC10" class="gmail-line" lang="plaintext">  File "<frozen importlib._bootstrap>", line 556, in module_from_spec</span>
<span id="gmail-LC11" class="gmail-line" lang="plaintext">  File "<frozen importlib._bootstrap_external>", line 1166, in create_module</span>
<span id="gmail-LC12" class="gmail-line" lang="plaintext">  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed</span>
<span id="gmail-LC13" class="gmail-line" lang="plaintext">ImportError: DLL load failed while importing _gdal: Impossível localizar o procedimento especificado.</span>
<span id="gmail-LC14" class="gmail-line" lang="plaintext"></span>
<span id="gmail-LC15" class="gmail-line" lang="plaintext">During handling of the above exception, another exception occurred:</span>
<span id="gmail-LC16" class="gmail-line" lang="plaintext"></span>
<span id="gmail-LC17" class="gmail-line" lang="plaintext">Traceback (most recent call last):</span>
<span id="gmail-LC18" class="gmail-line" lang="plaintext">  File "demo.py", line 1, in <module></span>
<span id="gmail-LC19" class="gmail-line" lang="plaintext">    from osgeo import gdal</span>
<span id="gmail-LC20" class="gmail-line" lang="plaintext">  File "C:\Users\PedroVenancio\anaconda3\envs\arosics\lib\site-packages\osgeo\__init__.py", line 37, in <module></span>
<span id="gmail-LC21" class="gmail-line" lang="plaintext">    _gdal = swig_import_helper()</span>
<span id="gmail-LC22" class="gmail-line" lang="plaintext">  File "C:\Users\PedroVenancio\anaconda3\envs\arosics\lib\site-packages\osgeo\__init__.py", line 34, in swig_import_helper</span>
<span id="gmail-LC23" class="gmail-line" lang="plaintext">    return importlib.import_module('_gdal')</span>
<span id="gmail-LC24" class="gmail-line" lang="plaintext">  File "C:\Users\PedroVenancio\anaconda3\envs\arosics\lib\importlib\__init__.py", line 127, in import_module</span>
<span id="gmail-LC25" class="gmail-line" lang="plaintext">    return _bootstrap._gcd_import(name[level:], package, level)</span>
<span id="gmail-LC26" class="gmail-line" lang="plaintext">ModuleNotFoundError: No module named '_gdal'</span>
</pre>
          </div>
          <div><br>
          </div>
        </div>
      </div>
    </blockquote>
    <pre class="moz-signature" cols="72">-- 
<a class="moz-txt-link-freetext" href="http://www.spatialys.com">http://www.spatialys.com</a>
My software is free, but my time generally not.</pre>
  </body>
</html>