Opened 5 years ago

Last modified 5 years ago

#590 closed defect

wrong version of numpy installed with gdal-python — at Initial Version

Reported by: monstermushroom Owned by: osgeo4w-dev@…
Priority: major Component: Package
Version: Keywords:
Cc:

Description

Hi,

on a clean windows 32 bit build, if installing msys, gdal, gdal-python, python and python-numpy:

open msys

$ python Python 2.7.14 (v2.7.14:84471935ed, Sep 16 2017, 20:19:30) [MSC v.1500 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information.

import numpy from osgeo import gdal from osgeo import gdalnumeric

RuntimeError: module compiled against API version 0xc but this version of numpy is 0x7 Traceback (most recent call last):

File "<stdin>", line 1, in <module> File "C:\OSGeo4W\apps\Python27\lib\site-packages\osgeo\gdalnumeric.py", line 2, in <module>

from osgeo.gdal_array import *

File "C:\OSGeo4W\apps\Python27\lib\site-packages\osgeo\gdal_array.py", line 17, in <module>

_gdal_array = swig_import_helper()

File "C:\OSGeo4W\apps\Python27\lib\site-packages\osgeo\gdal_array.py", line 16, in swig_import_helper

return importlib.import_module('_gdal_array')

File "C:\OSGeo4W\apps\Python27\lib\importlib\init.py", line 37, in import_module

import(name)

ImportError: No module named _gdal_array

exit()

In OSGEo4w, the only option is to download python-numpy version 1.7.0, and the alternate version is 1.5, although these are very old, and the latest versions under osgeo seem to be 1.12 and 1.15.

This appears to be because the python version is included in the file names of the older packets versions on the download site, making them seem as if they are newer. http://download.osgeo.org/osgeo4w/x86/release/python/python-numpy/

python-numpy-1.11.0-1.tar.bz2 18-Oct-2017 20:37 5.3M python-numpy-1.12.1+mkl-1.tar.bz2 10-Apr-2017 11:41 17M python-numpy-1.12.1-1.tar.bz2 06-Apr-2017 08:14 5.4M python-numpy-1.15.4-1.tar.bz2 02-Jan-2019 17:38 7.6M python-numpy-2.5-1.1.0-1.tar.bz2 22-Jun-2008 20:12 2.4M python-numpy-2.7-1.5.1-1.tar.bz2 07-May-2011 08:08 2.1M python-numpy-2.7-1.7.0-1.tar.bz2 28-May-2013 15:10 2.4M

The result of the error is that matplotlib and pandas will no longer function, since 1.7 is below their minimum versions, and also any script using gdal_calc, the gdal raster calculator, will also fail.

Is there a workaround for this? Can I make the setup look for the right version (which is probably 12?)

Thanks,

Change History (0)

Note: See TracTickets for help on using tickets.