12

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?

  • There is a chance that some of the folders you are working with contains character unrecognizable using UTF-8? Like á, é, ñ, è ? – guillermo_dangelo Nov 30 '18 at 18:00
  • This does not provide an answer to the question. To critique or request clarification from an author, leave a comment below their post. - From Review – Vince Nov 30 '18 at 19:35
  • @guillermo_dangelo I thought it could be that, but I tested moving the files to a "character safe" folder and it didn't do it. – rubslopes Dec 6 '18 at 16:40
3

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).

  • ... but for use in QGIS you have to stick to the GRASS version that is supported by QGIS. So for now, a virtual box with QGIS 2.18 LTR inside might be the best choice. – AndreJ Dec 1 '18 at 7:53
  • 1
    QGIS searches for grass74, grass72, grass70 to my knowledge. So you could use a simple trick and install GRASS GIS 7.6 and create a link to grass74. The software is 99.9% compatible... – markusN Dec 1 '18 at 16:34
  • Not if you want the GRASS plugin under Ubuntu. Currently, the Ubuntugis version of QGIS 3.4.2 does not install it because Ubuntugis has recently upgraded to GRASS 7.4.3, and QGIS expects grass-core and grass742. – AndreJ Dec 1 '18 at 17:00
  • Strange, normally things should be in sync. In case worth a bug report there. – markusN Dec 1 '18 at 17:03
  • So why the installation files tell me to install Python 3.6.x but says nothing about Python 2? It seems I could install QGIS 3 even without having Python2 on my machine. – rubslopes Dec 7 '18 at 19:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.