[GIS] GDAL scripts not working on QGIS and High Sierra

clipgdalinstallationmacqgis-3

I had the same issue that has already been posted with running GDAL scripts on MacOs with QGIS3. I am trying to clip a raster and used to get this error:

GDAL command output: /bin/sh: (scriptname).py: command not found

Then I followed the workaround from the readme.txt to use customs variable and now I have another error:

Traceback (most recent call last): File "/Applications/QGIS3.app/Contents/MacOS/../Resources/python/plugins/processing/algs/gdal/GdalAlgorithm.py", line 115, in processAlgorithm GdalUtils.runGdal(commands, feedback) 
File "/Applications/QGIS3.app/Contents/MacOS/../Resources/python/plugins/processing/algs/gdal/GdalUtils.py", line 83, in runGdal if not path.lower() in envval.lower().split(os.pathsep): 
AttributeError: 'NoneType' object has no attribute 'lower'

I also tried to re-install GDAL after QGIS3 but no luck.

I am running High Sierra 10.13.4 and QGIS3 3.0.2.
For info, it doesn't work on QGIS 2 either.

What can I do?

Best Answer

I had the same problem, I solved it by modifying in the preferences of QGIS, tab system, a PATH custom environment variable:

"Add to the end" | PATH | :/Library/Frameworks/GDAL.framework/Programs: /Library/Frameworks/PROJ.framework/Programs: /Library/Frameworks/SQLite3.framework/Programs:/Library/Frameworks/UnixImageIO.framework/Programs

Related Question