[Qgis-developer] qgis 3 still includes qt4+py2 stuff and missing _gdal_array.pyd
Idan Miara
idan at miara.com
Wed May 3 07:23:56 PDT 2017
Hi,
I wondered why does the latest qgis 3.0 weekly build (2.99.0-18) still
contains some qt4 and py2.7 binaries.
OSGeo4W.bat still defaults to qt4+py2.7 (separate batch files
qt5_env.bat, py3_env.bat are required to run in order to work with qt5+py3).
also, _gdal_array.pyd is missing from
apps\Python36\Lib\site-packages\osgeo
and available only on:
apps\Python27\Lib\site-packages\osgeo
(same for x64 and x86 releases)
[With the latest gisinternals binaries, I could find _gdal_array.pyd in the
file:
release-1800-gdal-mapserver.zip\bin\gdal\python\osgeo\_gdal_array.pyd
but not in the x64 version.]
thus the following code fails:
import gdal
x = gdal.Open(r'D:/Map Samples/1/DTM/n29w098d5dtm.tif') #valid tif
y = x.ReadAsArray()
print(y)
produces this error:
Traceback (most recent call last):
File "C:\PROGRA~1\QGIS2~1.99\apps\Python36\lib\site-packages\osgeo\gdal_array.py",
line 16, in swig_import_helper
fp, pathname, description = imp.find_module('_gdal_array',
[dirname(__file__)])
File "C:\PROGRA~1\QGIS2~1.99\apps\Python36\lib\imp.py", line 296, in
find_module
raise ImportError(_ERR_MSG.format(name), name=name)
ImportError: No module named '_gdal_array'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\PROGRA~1\QGIS2~1.99\apps\Python36\lib\code.py", line 91, in
runcode
exec(code, self.locals)
File "<input>", line 1, in <module>
File "<string>", line 3, in <module>
File "C:\PROGRA~1\QGIS2~1.99\apps\Python36\lib\site-packages\osgeo\gdal.py",
line 1817, in ReadAsArray
from . import gdalnumeric
File "C:/PROGRA~1/QGIS2~1.99/apps/qgis-dev/./python\qgis\utils.py", line
647, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
File "C:\PROGRA~1\QGIS2~1.99\apps\Python36\lib\site-packages\osgeo\gdalnumeric.py",
line 1, in <module>
from osgeo.gdal_array import *
File "C:/PROGRA~1/QGIS2~1.99/apps/qgis-dev/./python\qgis\utils.py", line
647, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
File "C:\PROGRA~1\QGIS2~1.99\apps\Python36\lib\site-packages\osgeo\gdal_array.py",
line 26, in <module>
_gdal_array = swig_import_helper()
File "C:\PROGRA~1\QGIS2~1.99\apps\Python36\lib\site-packages\osgeo\gdal_array.py",
line 18, in swig_import_helper
import _gdal_array
File "C:/PROGRA~1/QGIS2~1.99/apps/qgis-dev/./python\qgis\utils.py", line
647, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
ModuleNotFoundError: No module named '_gdal_array'
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20170503/489d1241/attachment.html>
More information about the QGIS-Developer
mailing list