3

Today I've been messing around with QGIS installations and I think I've accidentally caused a problem: QGIS is no longer able to execute the GDAL raster tool 'Fill no data' and other GDAL tools that use Python.

I am using Windows 10 and installed QGIS 3.10.1 from www.qgis.org using the standalone QGIS version. Later, I uninstalled that installation from my pc, and installed QGIS and GDAL and GRASS GIS using the OSGeo4W Network installer (also through www.qgis.org). Then I couldn't figure out how to remove the OSGeo4W installation, so I just deleted the folder 'OSGeo4W' on my C:\ drive. And then I installed the standalone QGIS version again.

At this point, whenever I try to execute the GDAL tool 'Fill no data' on a raster layer in QGIS, I get the following error. Other GDAL tools that use Python generate the same error.

2019-12-11T17:20:16     INFO    python3 -m gdal_fillnodata -md 10 -b 1 -of GTiff C:/Users/username/Downloads/ahn_ruw/M_32GZ2.TIF C:/Users/username/Downloads/ahn_fill/test.tif
2019-12-11T17:20:16     INFO    GDAL execution console output
             C:\PROGRA~1\QGIS3~1.10\bin\python3.exe: No module named gdal_fillnodata

What I think is happening is that my current QGIS installation is looking for a non-existent Python/GDAL installation in the old OSGeo4W folder. Or some other confusing with different installations of Python/GDAL. I think it is a Python problem.

I have tried this but that didn't work. I've also tried changing the system variable PATH in QGIS under Settings > System to the folder C:\Program Files\QGIS 3.10\apps\Python37 but that didn't work. It seems that the correct path (C:\Program Files\QGIS 3.10\apps\Python37) is already in the system variable PATH.

Does somebody know how to fix this?

Geert
  • 143
  • 1
  • 7
  • 1
    Do the other GDAL commands work? Or is it only gdal_fillnodata? – webrian Dec 12 '19 at 18:15
  • Only the GDAL commands that use python3 give the error. So for example, gdal2xyz doesn't work either. So I guess it's a python3 problem. I'll update my post. – Geert Dec 12 '19 at 20:11
  • 3
    How is PYTHONPATH set? Is gdal_fillnodata.py present in any folder? Try setting PYTHONPATH to the folder where htere is gdal_fillnodata.py. – Andrea Giudiceandrea Dec 13 '19 at 17:03
  • 1
    @AndreaGiudiceandrea thanks, that worked! Problem solved :-) gdal_nofilldata.py is present in the folder C:\Program Files\QGIS 3.10\apps\Python37\Scripts. I added that folder to PATH and PYTHONPATH and now it works again. – Geert Dec 13 '19 at 21:39
  • 1
    The bug was reported to QGIS developers https://github.com/qgis/QGIS/issues/33386 and it should now be resolved updating "python3-gdal2" / "gdal2-python" packages to 2.4.3-2 version without the need of manually set the PYTHONPATH environomental variable. – Andrea Giudiceandrea Dec 18 '19 at 12:34
  • Also the package python3-core has been updated to version 3.7.0-4 in order to fix the bug for QGIS versions (like 3.10.1 on Windows) that use GDAL 3. – Andrea Giudiceandrea Jan 06 '20 at 07:03

0 Answers0