<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p><br>
</p>
<div class="moz-cite-prefix">Le 15/10/2021 à 14:05, Pedro Venâncio a
écrit :<br>
</div>
<blockquote type="cite"
cite="mid:CAMCJChurBgsCDKRYN9A1w7ABNaj0Qk27qn23jj5mYaaqRdQ4vw@mail.gmail.com">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<div dir="ltr">
<div>Hi Even,</div>
<div><br>
</div>
<div>I've been trying to tackle this issue and these are my last
findings:</div>
<div><br>
</div>
<div><a
href="https://github.com/conda-forge/gdal-feedstock/issues/541#issuecomment-944228747"
target="_blank" moz-do-not-send="true">https://github.com/conda-forge/gdal-feedstock/issues/541#issuecomment-944228747</a></div>
<div><br>
</div>
<code></code>
<div>
</div>
<div>Does this make sense to you? Do you remember any change
between<code> gdal <code>3.2.1</code>
and <code></code></code><code><code>3.2.2</code></code><code></code>
<code><code> </code>
</code> that can explain this behaviour?<br>
</div>
</div>
</blockquote>
No, looking at the git diff, nothing significant in the Python
bindings has changed between 3.2.1 and 3.2.2<br>
<blockquote type="cite"
cite="mid:CAMCJChurBgsCDKRYN9A1w7ABNaj0Qk27qn23jj5mYaaqRdQ4vw@mail.gmail.com">
<div dir="ltr">
<div><br>
</div>
<div>Thank you very much!</div>
<div><br>
</div>
<div>Pedro<br>
</div>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">Alexandre Neto <<a
href="mailto:senhor.neto@gmail.com" target="_blank"
moz-do-not-send="true">senhor.neto@gmail.com</a>>
escreveu no dia quinta, 14/10/2021 à(s) 01:26:<br>
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px
0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div dir="auto">Hi pedro,
<div dir="auto"><br>
</div>
<div dir="auto">Are you sure you are not mixing conda
channels? Normally, in the same environment, you should
stick to a single channel to avoid dependency problems. </div>
<div dir="auto"><br>
</div>
<div dir="auto">I also noticed that you are using anaconda.
I suggest you use miniconda instead. It comes with the
bare minimal tools to install and manage the packages you
explicitly want, instead of installating Gb of packages
that unless you know them, you will never use.</div>
<div dir="auto"><br>
</div>
<div dir="auto">Alexandre Neto</div>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">A quarta, 13/10/2021,
17:16, Pedro Venâncio <<a
href="mailto:pedrongvenancio@gmail.com" rel="noreferrer"
target="_blank" moz-do-not-send="true">pedrongvenancio@gmail.com</a>>
escreveu:<br>
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px
0.8ex;border-left:1px solid
rgb(204,204,204);padding-left:1ex">
<div dir="ltr">
<div>I will ask on GDAL conda-forge, maybe this can be
some packaging problem. <br>
</div>
<div><br>
</div>
<div>Thanks!</div>
<div><br>
</div>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">Pedro Venâncio <<a
href="mailto:pedrongvenancio@gmail.com"
rel="noreferrer noreferrer" target="_blank"
moz-do-not-send="true">pedrongvenancio@gmail.com</a>>
escreveu no dia quarta, 13/10/2021 à(s) 17:00:<br>
</div>
<blockquote class="gmail_quote" style="margin:0px 0px
0px 0.8ex;border-left:1px solid
rgb(204,204,204);padding-left:1ex">
<div dir="ltr">
<div>Tried to define several environment variables,
but nothing seems to work</div>
<div><br>
</div>
<div><img alt="env_win10.jpg" moz-do-not-send="true"
width="529" height="159"><br>
</div>
<div><br>
</div>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">Joaquim Manuel
Freire Luís <<a href="mailto:jluis@ualg.pt"
rel="noreferrer noreferrer" target="_blank"
moz-do-not-send="true">jluis@ualg.pt</a>>
escreveu no dia quarta, 13/10/2021 à(s) 16:23:<br>
</div>
<blockquote class="gmail_quote" style="margin:0px
0px 0px 0.8ex;border-left:1px solid
rgb(204,204,204);padding-left:1ex">
<div lang="PT">
<div>
<p class="MsoNormal"><span>Não Pedro,</span></p>
<p class="MsoNormal"><span> </span></p>
<p class="MsoNormal"><span lang="EN-US">When I
look into my own build of the gdall dll I
see no dependency on that
“opj_encoder_set_extra_options” but likely
because it’s a different version (I build
from master).</span></p>
<p class="MsoNormal"><span lang="EN-US"> </span></p>
<p class="MsoNormal"><span lang="EN-US">From
my experience on this there is really
nothing one can do other than rebuild the
dll or replace the dependency that is
missing the required symbol. Nothing we
can do from a conda installation.</span></p>
<p class="MsoNormal"><span lang="EN-US"> </span></p>
<p class="MsoNormal"><span lang="EN-US">But
ofc my analysis may be all wrong.</span></p>
<p class="MsoNormal"><span lang="EN-US"> </span></p>
<p class="MsoNormal"><span lang="EN-US">Joaquim</span></p>
<p class="MsoNormal"><span lang="EN-US"> </span></p>
<div style="border-color:rgb(225,225,225)
currentcolor currentcolor;border-style:solid
none none;border-width:1pt medium
medium;padding:3pt 0in 0in">
<p class="MsoNormal"><b><span lang="EN-US">From:</span></b><span
lang="EN-US"> gdal-dev <<a
href="mailto:gdal-dev-bounces@lists.osgeo.org"
rel="noreferrer noreferrer"
target="_blank" moz-do-not-send="true">gdal-dev-bounces@lists.osgeo.org</a>>
<b>On Behalf Of </b>Pedro Venâncio<br>
<b>Sent:</b> Wednesday, October 13, 2021
4:04 PM<br>
<b>To:</b> <a
href="mailto:gdal-dev@lists.osgeo.org"
rel="noreferrer noreferrer"
target="_blank" moz-do-not-send="true">gdal-dev@lists.osgeo.org</a><br>
<b>Subject:</b> Re: [gdal-dev] Running
GDAL through Python >= 3.8 on
Anaconda - DLL load failed</span></p>
</div>
<p class="MsoNormal"><span lang="EN-US"> </span></p>
<div>
<div>
<p class="MsoNormal">Hi Joaquim,</p>
</div>
<div>
<p class="MsoNormal"> </p>
</div>
<div>
<p class="MsoNormal">Thanks for sharing
your case. Did you manage to make it
work in some way?</p>
</div>
<div>
<p class="MsoNormal"> </p>
</div>
<div>
<p class="MsoNormal">I've already
uninstalled a test PostgreSQL/PostGIS
that I supposed to be the source of the
conflict, but I keep having the same
error.
</p>
</div>
<div>
<p class="MsoNormal"> </p>
</div>
<div>
<p class="MsoNormal">I also reinstalled
conda, but nothing had changed.</p>
</div>
<div>
<p class="MsoNormal"> </p>
</div>
<div>
<p class="MsoNormal"> </p>
</div>
</div>
<p class="MsoNormal"> </p>
<div>
<div>
<p class="MsoNormal">Joaquim Manuel Freire
Luís <<a href="mailto:jluis@ualg.pt"
rel="noreferrer noreferrer"
target="_blank" moz-do-not-send="true">jluis@ualg.pt</a>>
escreveu no dia quarta, 13/10/2021 à(s)
15:24:</p>
</div>
<blockquote style="border-color:currentcolor
currentcolor currentcolor
rgb(204,204,204);border-style:none none
none solid;border-width:medium medium
medium 1pt;padding:0in 0in 0in
6pt;margin-left:4.8pt;margin-right:0in">
<div>
<div>
<p class="MsoNormal">Hi,</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal"><span
lang="EN-US">I have a certain
horror to python (that I’m trying
to fight) a bit of it is because I
never manage to really use it.
</span></p>
<p class="MsoNormal"><span
lang="EN-US"> </span></p>
<p class="MsoNormal"><span
lang="EN-US">I had and older
Miniconda (Mini => 18 GB !!!!)
that was so big that I removed and
installed a new one in which I
tried Pedro’s case and got exactly
the same errors.</span></p>
<p class="MsoNormal"><span
lang="EN-US"> </span></p>
<p class="MsoNormal"><span
lang="EN-US">I then run a
dependency analysis from within
the conda shell and found two
weird things</span></p>
<p class="MsoNormal"><span
lang="EN-US"> </span></p>
<ol type="1" start="1">
<li>
<span lang="EN-US">The gdal dll
depends on a xerces-c_3_2.dll
locate at C:\WINDOWS\system32.
This seems quite dangerous (for
dependency sakes) but seems to
not cause any problem in this
case.</span></li>
<li>
<span lang="EN-US">There is a “red
mark” on the
opj_encoder_set_extra_options
symbol and this alone can
explain the “ImportError: DLL
load failed while importing
_gdal: The specified procedure
could not be found.”</span></li>
</ol>
<p class="MsoNormal"><span
lang="EN-US"> </span></p>
<p class="MsoNormal"><span
lang="EN-US">Hopefully the screen
capture is small enough to get
through.</span></p>
<p class="MsoNormal"><span
lang="EN-US"> </span></p>
<p class="MsoNormal"><span
lang="EN-US">Joaquim</span></p>
<p class="MsoNormal"><span
lang="EN-US"> </span></p>
<div>
<div style="border-style:solid none
none;border-width:1pt medium
medium;padding:3pt 0in
0in;border-color:currentcolor">
<p class="MsoNormal"><b><span
lang="EN-US">From:</span></b><span
lang="EN-US"> gdal-dev <<a
href="mailto:gdal-dev-bounces@lists.osgeo.org" rel="noreferrer
noreferrer" target="_blank"
moz-do-not-send="true">gdal-dev-bounces@lists.osgeo.org</a>>
<b>On Behalf Of </b>Even
Rouault<br>
<b>Sent:</b> Wednesday,
October 13, 2021 2:39 PM<br>
<b>To:</b> Pedro Venâncio <<a
href="mailto:pedrongvenancio@gmail.com" rel="noreferrer noreferrer"
target="_blank"
moz-do-not-send="true">pedrongvenancio@gmail.com</a>><br>
<b>Cc:</b> <a
href="mailto:gdal-dev@lists.osgeo.org"
rel="noreferrer noreferrer"
target="_blank"
moz-do-not-send="true">gdal-dev@lists.osgeo.org</a><br>
<b>Subject:</b> Re: [gdal-dev]
Running GDAL through Python
>= 3.8 on Anaconda - DLL
load failed</span></p>
</div>
</div>
<p class="MsoNormal"> </p>
<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?</p>
<div>
<p class="MsoNormal">Le 13/10/2021 à
15:36, Pedro Venâncio a écrit :</p>
</div>
<blockquote
style="margin-top:5pt;margin-bottom:5pt;border-color:currentcolor
currentcolor currentcolor
rgb(204,204,204)">
<div>
<div>
<blockquote
style="border-color:currentcolor
currentcolor currentcolor
windowtext;border-style:none
none none
solid;border-width:medium
medium medium 1pt;padding:0in
0in 0in 6pt;margin:5pt 0in 5pt
4.8pt">
<div>
<p>Can you change in
__init__.py</p>
<p> try:<br>
os.add_dll_directory(p)<br>
except
FileNotFoundError:<br>
continue</p>
<p> </p>
<p>to</p>
<p> try:<br>
os.add_dll_directory(p)<br>
except
(FileNotFoundError,
OSError):<br>
continue</p>
</div>
</blockquote>
<div>
<p class="MsoNormal"> </p>
</div>
<div>
<p class="MsoNormal">Yes, here
is the output:</p>
</div>
<div>
<pre><span>Traceback (most recent call last):</span></pre>
<pre><span> File "C:\Users\PedroVenancio\anaconda3\envs\arosics\lib\site-packages\osgeo\__init__.py", line 21, in swig_import_helper</span></pre>
<pre><span> return importlib.import_module(mname)</span></pre>
<pre><span> File "C:\Users\PedroVenancio\anaconda3\envs\arosics\lib\importlib\__init__.py", line 127, in import_module</span></pre>
<pre><span> return _bootstrap._gcd_import(name[level:], package, level)</span></pre>
<pre><span> File "<frozen importlib._bootstrap>", line 1014, in _gcd_import</span></pre>
<pre><span> File "<frozen importlib._bootstrap>", line 991, in _find_and_load</span></pre>
<pre><span> File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked</span></pre>
<pre><span> File "<frozen importlib._bootstrap>", line 657, in _load_unlocked</span></pre>
<pre><span> File "<frozen importlib._bootstrap>", line 556, in module_from_spec</span></pre>
<pre><span> File "<frozen importlib._bootstrap_external>", line 1166, in create_module</span></pre>
<pre><span> File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed</span></pre>
<pre><span>ImportError: DLL load failed while importing _gdal: Impossível localizar o procedimento especificado.</span></pre>
<pre> </pre>
<pre><span>During handling of the above exception, another exception occurred:</span></pre>
<pre> </pre>
<pre><span>Traceback (most recent call last):</span></pre>
<pre><span> File "demo.py", line 1, in <module></span></pre>
<pre><span> from osgeo import gdal</span></pre>
<pre><span> File "C:\Users\PedroVenancio\anaconda3\envs\arosics\lib\site-packages\osgeo\__init__.py", line 37, in <module></span></pre>
<pre><span> _gdal = swig_import_helper()</span></pre>
<pre><span> File "C:\Users\PedroVenancio\anaconda3\envs\arosics\lib\site-packages\osgeo\__init__.py", line 34, in swig_import_helper</span></pre>
<pre><span> return importlib.import_module('_gdal')</span></pre>
<pre><span> File "C:\Users\PedroVenancio\anaconda3\envs\arosics\lib\importlib\__init__.py", line 127, in import_module</span></pre>
<pre><span> return _bootstrap._gcd_import(name[level:], package, level)</span></pre>
<pre><span>ModuleNotFoundError: No module named '_gdal'</span></pre>
</div>
<div>
<p class="MsoNormal"> </p>
</div>
</div>
</div>
</blockquote>
<pre>-- </pre>
<pre><a href="http://www.spatialys.com" rel="noreferrer noreferrer" target="_blank" moz-do-not-send="true">http://www.spatialys.com</a></pre>
<pre>My software is free, but my time generally not.</pre>
</div>
</div>
</blockquote>
</div>
</div>
</div>
</blockquote>
</div>
</blockquote>
</div>
_______________________________________________<br>
gdal-dev mailing list<br>
<a href="mailto:gdal-dev@lists.osgeo.org" rel="noreferrer
noreferrer" target="_blank" moz-do-not-send="true">gdal-dev@lists.osgeo.org</a><br>
<a
href="https://lists.osgeo.org/mailman/listinfo/gdal-dev"
rel="noreferrer noreferrer noreferrer" target="_blank"
moz-do-not-send="true">https://lists.osgeo.org/mailman/listinfo/gdal-dev</a><br>
</blockquote>
</div>
</blockquote>
</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>