[gdal-dev] GDAL 2.4.0 - Import Error with module _gdal_array

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

[gdal-dev] GDAL 2.4.0 - Import Error with module _gdal_array

Pedro Venâncio-2

I'm getting an Import Error "No module named _gdal_array" with GDAL 2.4.0, that does not happened before, with GDAL <= 2.3.2.

C:\>gdalinfo --version
GDAL 2.4.0, released 2018/12/14

Python 2.7.14 (v2.7.14:84471935ed, Sep 16 2017, 20:25:58) [MSC v.1500 64 bit (AMD64)] on win32

>>> from osgeo import gdal_array
RuntimeError: module compiled against API version 0xc but this version of numpy is 0xa
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\OSGEO4~1\apps\Python27\lib\site-packages\osgeo\gdal_array.py", line 17, in <module>
    _gdal_array = swig_import_helper()
  File "C:\OSGEO4~1\apps\Python27\lib\site-packages\osgeo\gdal_array.py", line 16, in swig_import_helper
    return importlib.import_module('_gdal_array')
  File "C:\OSGEO4~1\apps\Python27\lib\importlib\__init__.py", line 37, in import_module
ImportError: No module named _gdal_array

>>> import numpy
>>> numpy.version.version

Testing with an old version:

C:\>gdalinfo --version
GDAL 2.2.3, released 2017/11/20

Python 2.7.5 (default, May 15 2013, 22:44:16) [MSC v.1500 64 bit (AMD64)] on win32

>>> from osgeo import gdal_array

>>> gdal_array
<module 'osgeo.gdal_array' from 'C:\PROGRA~1\QGIS2~1.14\apps\Python27\lib\site-packages\osgeo\gdal_array.py'>

>>> import numpy
>>> numpy.version.version

This is happening in a Windows 10 machine, with OSGeo4W 64bits.

Any hint?

Thank you very much!

Best regards,
Pedro Venâncio

gdal-dev mailing list
[hidden email]