<div dir="ltr">Hi Even, my distro is: <span style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0);font-family:Menlo;font-size:11px">Debian GNU/Linux 11 (bullseye)<br></span>Btw using pip3 install --force-reinstall gdal==3.2.2 --no-cache-dir works fine.</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Il giorno ven 24 set 2021 alle ore 15:14 Even Rouault <<a href="mailto:even.rouault@spatialys.com">even.rouault@spatialys.com</a>> ha scritto:<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>
<p>Lorenzo,</p>
<p>you didn't mention which Linux distro you used and how you
installed numpy</p>
<p>I'm aware at least that on Alpine Linux, you need to install an
additional py3-numpy-dev package with the headers & lib needed
to use the C API of numpy, which is needed by the GDAL Python
bindings</p>
<p>Check that the following returns something sensible<br>
</p>
<p>python3 -c "import numpy; print(numpy.get_include())"</p>
<p>when you build the GDAL python bindings look for the following
messages in the output that will indicate that the gdal_array
module can't be built<br>
</p>
<p>"WARNING: numpy headers were not found! Array support will not
be enabled"</p>
<p>or<br>
</p>
<p>'WARNING: numpy not available! Array support will not be
enabled'</p>
<p>Even<br>
</p>
<div>Le 24/09/2021 à 14:53, Lorenzo Di
Giacomo a écrit :<br>
</div>
<blockquote type="cite">
<div dir="ltr">Hi everyone, basically i build from source GDAL
3.2.2 and install the python bindings via pip3 install
gdal==3.2.2 <br>
<br>
Later i install numpy, i have read online that the numpy must be
installed before GDAL python bindings.<br>
So i tried to uninstall python gdal and than reinstall it, but
the problem still persists.<br>
<br>
Do you have any suggestions about it?<br>
<br>
Python3 libraries:<br>
GDAL 3.2.2<br>
NUMPY 1.21.2<br>
<br>
SWIG 4.0.2<br>
<br>
LOG:<br>
<pre style="margin-top:0px;margin-bottom:0px;border:0px">ModuleNotFoundError: No module named 'osgeo._gdal_array'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "temp-1544239507789228725main.py", line 98, in <module>
SSRD,gtSSRD = tiff2array(path_to_tiff, band_SSRD)
File "/hadoop/yarn/local/usercache/dispatcher/appcache/application_1628674283442_0030/container_e33_1628674283442_0030_01_000001/61a5101c-d78d-494d-b0d6-ef16719143719035222534140350861632485975806.zip/utility/rasterutils.py", line 58, in tiff2array
File "/usr/local/lib/python3.7/site-packages/osgeo/gdal.py", line 3832, in ReadAsArray
from osgeo import gdalnumeric
File "/usr/local/lib/python3.7/site-packages/osgeo/gdalnumeric.py", line 2, in <module>
from osgeo.gdal_array import *
File "/usr/local/lib/python3.7/site-packages/osgeo/gdal_array.py", line 17, in <module>
_gdal_array = swig_import_helper()
File "/usr/local/lib/python3.7/site-packages/osgeo/gdal_array.py", line 16, in swig_import_helper
return importlib.import_module('_gdal_array')
File "/usr/local/lib/python3.7/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
ModuleNotFoundError: No module named '_gdal_array'</pre>
</div>
<br>
<fieldset></fieldset>
<pre>_______________________________________________
gdal-dev mailing list
<a href="mailto:gdal-dev@lists.osgeo.org" target="_blank">gdal-dev@lists.osgeo.org</a>
<a href="https://lists.osgeo.org/mailman/listinfo/gdal-dev" target="_blank">https://lists.osgeo.org/mailman/listinfo/gdal-dev</a>
</pre>
</blockquote>
<pre cols="72">--
<a href="http://www.spatialys.com" target="_blank">http://www.spatialys.com</a>
My software is free, but my time generally not.</pre>
</div>
_______________________________________________<br>
gdal-dev mailing list<br>
<a href="mailto:gdal-dev@lists.osgeo.org" target="_blank">gdal-dev@lists.osgeo.org</a><br>
<a href="https://lists.osgeo.org/mailman/listinfo/gdal-dev" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/gdal-dev</a><br>
</blockquote></div>