Opened 3 years ago

Last modified 15 months ago

#588 closed defect

gdal_merge.bat Runtime Error. QGIS 3.4.3 Standalone Installers for 32 and 64 bit Windows systems — at Version 2

Reported by: gabrieldeluca Owned by: osgeo4w-dev@…
Priority: major Component: Package
Version: Keywords: qgis-3 gdal-merge numpy

Description (last modified by jef)

On clean installs of the QGIS 3.4.3 Standallone Installers for 32 and 64 bit builds for Windows systems, the GDAL Merge tool produces images with only zero values in all pixels when the result is saved to a temporary file (if not, the merged file is well generated but the command output is the same).


Processing algorithm…
Algorithm 'Merge' starting…
Input parameters:
{ 'DATA_TYPE' : 5, 'INPUT' : ['D:/test/merge/S44E170.hgt','D:/test/merge/S44E171.hgt'], 'NODATA_INPUT' : None, 'NODATA_OUTPUT' : None, 'OPTIONS' : '', 'OUTPUT' : 'C:/Users/Gabriel/AppData/Local/Temp/processing_6e5c1804cb924bf882b2ccc82074d4cc/3b8fd4e987774e5fb55ea11a62d9420c/OUTPUT.tif', 'PCT' : False, 'SEPARATE' : False }

GDAL command:
cmd.exe /C gdal_merge.bat -ot Float32 -of GTiff -o C:/Users/Gabriel/AppData/Local/Temp/processing_6e5c1804cb924bf882b2ccc82074d4cc/3b8fd4e987774e5fb55ea11a62d9420c/OUTPUT.tif --optfile C:/Users/Gabriel/AppData/Local/Temp/processing_6e5c1804cb924bf882b2ccc82074d4cc\mergeInputFiles.txt
GDAL command output:
0RuntimeError: module compiled against API version 0xc but this version of numpy is 0xa

Traceback (most recent call last):

File "C:\PROGRA~1\QGIS3~1.4\bin\", line 611, in <module>


File "C:\PROGRA~1\QGIS3~1.4\bin\", line 596, in main

fi.copy_into(t_fh, band, band, nodata)

File "C:\PROGRA~1\QGIS3~1.4\bin\", line 343, in copy_into


File "C:\PROGRA~1\QGIS3~1.4\bin\", line 124, in raster_copy


File "C:\PROGRA~1\QGIS3~1.4\bin\", line 180, in raster_copy_with_mask

t_xsize, t_ysize)

File "C:\PROGRA~1\QGIS3~1.4\apps\Python27\lib\site-packages\osgeo\", line 2635, in ReadAsArray

from osgeo import gdalnumeric

File "C:\PROGRA~1\QGIS3~1.4\apps\Python27\lib\site-packages\osgeo\", line 2, in <module>

from osgeo.gdal_array import *

File "C:\PROGRA~1\QGIS3~1.4\apps\Python27\lib\site-packages\osgeo\", line 17, in <module>

_gdal_array = swig_import_helper()

File "C:\PROGRA~1\QGIS3~1.4\apps\Python27\lib\site-packages\osgeo\", line 16, in swig_import_helper

return importlib.import_module('_gdal_array')

File "C:\PROGRA~1\QGIS3~1.4\apps\Python27\lib\importlib\", line 37, in import_module


ImportError: No module named _gdal_array

Execution completed in 1.81 seconds
{'OUTPUT': <QgsProcessingOutputLayerDefinition {'sink':C:/Users/Gabriel/AppData/Local/Temp/processing_6e5c1804cb924bf882b2ccc82074d4cc/3b8fd4e987774e5fb55ea11a62d9420c/OUTPUT.tif, 'createOptions': {'fileEncoding': 'System'}}>}

Loading resulting layers
Algorithm 'Merge' finished

Manually solved from the OSGeo4W.bat (as Administrator) shell:

C:\Windows\System32>python -m pip install -U numpy
Collecting numpy
  Using cached
Installing collected packages: numpy
  Found existing installation: numpy 1.12.1+mkl
    Uninstalling numpy-1.12.1+mkl:
      Successfully uninstalled numpy-1.12.1+mkl
Successfully installed numpy-1.15.4

After that, Merge tool works fine and without error logs.

Tested with the builds:

in Windows 7 and Windows 10, with the following data:

Reports found: SE Getting black square after merging two rasters in QGIS

QGIS #20835

Change History (2)

comment:1 by gabrieldeluca, 3 years ago


comment:2 by jef, 3 years ago

Description: modified (diff)
Summary: gdal_merge.bat Runtime Error. QGIS 3.4.3 Standallone Installers for 32 and 64 bit Windows systemsgdal_merge.bat Runtime Error. QGIS 3.4.3 Standalone Installers for 32 and 64 bit Windows systems
Note: See TracTickets for help on using tickets.