Bug report #21210

GDAL python tools are broken in QGIS 3.4.4/master

Added by Giovanni Manghi almost 2 years ago. Updated almost 2 years ago.

Status:Closed
Priority:High
Assignee:-
Category:Windows Package
Affected QGIS version:3.5(master) Regression?:Yes
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:No Copied to github as #:29028

Description

for example gdal_merge

GDAL command:
cmd.exe /C gdal_merge.bat -ot Float32 -of GTiff -o C:/Users/qgis/AppData/Local/Temp/processing_7c972bb45de649dba703b37af8e39225/a14f75dc2cc3467ea263dfff8f94899e/OUTPUT.tif --optfile C:/Users/qgis/AppData/Local/Temp/processing_7c972bb45de649dba703b37af8e39225\mergeInputFiles.txt
GDAL command output:
'gdal_merge.bat' is not recognized as an internal or external command,

Associated revisions

Revision eea4eda6
Added by Jürgen Fischer almost 2 years ago

osgeo4w: fix b6293f23c8c (fixes #21210)

Revision 69e54150
Added by Jürgen Fischer almost 2 years ago

osgeo4w: fix b6293f23c8c (fixes #21210)

(cherry picked from commit eea4eda6a35f1a06f84f198249b51b169144c46f)

History

#1 Updated by Alexander Bruy almost 2 years ago

I can confirm on Windows with master/3.4, but errors are a slightly different. 3.4 complains about missed gdal_merge.bat, while in master it can not find gdal_merge.py

#2 Updated by Giovanni Manghi almost 2 years ago

Alexander Bruy wrote:

I can confirm on Windows with master/3.4, but errors are a slightly different. 3.4 complains about missed gdal_merge.bat, while in master it can not find gdal_merge.py

confimed here the slightly different message.

#3 Updated by Nyall Dawson almost 2 years ago

  • Status changed from Open to Feedback

So this is an osgeo4w packaging issue, right? Not qgis?

#4 Updated by Giovanni Manghi almost 2 years ago

Nyall Dawson wrote:

So this is an osgeo4w packaging issue, right? Not qgis?

probably, but I'm afraid that at this point filing this bug only in the ogseo4w bug tracker will pass unnoticed and we will ship a new release with such important tools broken.

#5 Updated by Giovanni Manghi almost 2 years ago

  • Status changed from Feedback to Open

#6 Updated by Nyall Dawson almost 2 years ago

  • Category changed from Processing/GDAL to Windows Package

#8 Updated by Jürgen Fischer almost 2 years ago

Giovanni Manghi wrote:

'gdal_merge.bat' is not recognized as an internal or external command,

Does gdal_merge.bat exist in %OSGEO4W_ROOT%\bin? Should have been created by etc/postinstall/gdal-python.bat (which runs bin/make-bat-for-py.bat) after gdal-python was installed.

#9 Updated by Jürgen Fischer almost 2 years ago

  • Status changed from Open to Feedback

#10 Updated by Jürgen Fischer almost 2 years ago

Alexander Bruy wrote:

I can confirm on Windows with master/3.4, but errors are a slightly different. 3.4 complains about missed gdal_merge.bat, while in master it can not find gdal_merge.py

Oh, well. Findings so far: 3.4 runs the batch files which only gdal-python (GDAL Py2 bindings) provides - but it's didn't depend on it, because QGIS normally uses python3 - hence the batch files calls fail. It starts working once that is installed (and a dependency was added).

master was changed to run the scripts directly with python3 (see #20870). That only helps if if the scripts are in the current working directory - but that usually
is %OSGEO4W_ROOT%\bin, which also happens to be where gdal-python puts the scripts - intended for py2, but not any different from those for py3. So with gdal-python scripts installed it should work there too - often.

My expectation was, that python would look in PATH or PYTHONPATH for script files - apparently not happening.

#11 Updated by Jürgen Fischer almost 2 years ago

  • % Done changed from 0 to 100
  • Status changed from Feedback to Closed

Also available in: Atom PDF