[GIS] GRASS Processing not working on QGIS

grassinstallationmacqgis

I've been having several issues making GRASS algorithms work from the Processing toolbox.

When you fresh install QGIS 3.4 (MacOS High Sierra), first it doesn't find python — which I solved by creating a custom PATH variable. Then it complains about inconsistent use of tabs and spaces, which I also solved by editing the grass74 file inside the QGIS app. Now I'm getting this error whatever GRASS algorithm I use:

WARNING: Default locale settings are missing. GRASS running with C locale.
Default locale not found, using UTF-8
Traceback (most recent call last):
File "/Applications/QGIS3.app/Contents/MacOS/grass/grass74", line 2029, in <module>
main()
File "/Applications/QGIS3.app/Contents/MacOS/grass/grass74", line 1880, in main
set_paths(grass_config_dir=grass_config_dir)
File "/Applications/QGIS3.app/Contents/MacOS/grass/grass74", line 622, in set_paths
os.environ['MANPATH'] = sys_man_path
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/os.py", line 674, in __setitem__
value = self.encodevalue(value)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/os.py", line 744, in encode
raise TypeError("str expected, not %s" % type(value).__name__)
TypeError: str expected, not bytes

Right now I have Python 3.6.6 installed and QGIS 3.4.2 (the most recent 24Nov2018 release), but I've also tried with Python 3.6.5, Python 3.6.7, QGIS 3.0, 3.2, 3.3, 3.4.1… No good, same error.

I found people around here having similar problems (related to encoding) for Windows QGIS, which was solved but setting the Windows region to USA. Although my OS is in Portuguese, I'm using the QGIS in English and tried setting the OS to America region and English language, but the error persists.

Does anyone know anything about this?

Best Answer

GRASS GIS 7.4 only works with Python 2. We are working on the update which is mostly done in the current development version GRASS GIS 7.7 (to become 7.8 stable then or even 8.0).

If possible for you, consider to update to GRASS GIS 7.6 which will be released soon (along with Python 2).

Edit Sep 2019:

GRASS GIS 7.8.0 with Python 3 support as been released: