Bug report #17443

PROCESSING: Mac OS Grass help path error

Added by Gary Sherman over 2 years ago. Updated over 2 years ago.

Status:Closed
Priority:Normal
Assignee:Victor Olaya
Category:Processing/GRASS
Affected QGIS version:master Regression?:No
Operating System:Mac OS Sierra Easy fix?:No
Pull Request or Patch supplied:No Resolution:fixed/implemented
Crashes QGIS or corrupts data:No Copied to github as #:25340

Description

grassHelpPath is returning None, but error is not handled.

TypeError: expected str, bytes or os.PathLike object, not NoneType 
Traceback (most recent call last):
  File "/Users/gsherman/apps/QGIS.app/Contents/MacOS/../Resources/python/plugins/processing/algs/grass7/Grass7AlgorithmProvider.py", line 73, in load
    Grass7Utils.grassHelpPath()))
  File "/Users/gsherman/apps/QGIS.app/Contents/MacOS/../Resources/python/plugins/processing/algs/grass7/Grass7Utils.py", line 506, in grassHelpPath
    localPath = os.path.join(Grass7Utils.path, 'docs/html')
  File "/usr/local/opt/python3/Frameworks/Python.framework/Versions/3.6/lib/python3.6/posixpath.py", line 78, in join
    a = os.fspath(a)
TypeError: expected str, bytes or os.PathLike object, not NoneType

Python version: 3.6.3 (default, Nov  1 2017, 10:15:09) [GCC 4.2.1 Compatible Apple LLVM 8.1.0 (clang-802.0.42)] 
QGIS version: 2.99.0-Master Master, 66518eb

Clicking OK allows QGIS to complete initialization.
The last build I have archived that worked was 940c4ed.

Associated revisions

Revision 03e4756d
Added by Alexander Bruy over 2 years ago

[processing] don't throw error if GRASS not found on Mac (fix #17443)

History

#1 Updated by Gary Sherman over 2 years ago

This is related to GRASS installed by Homebrew. The detection code doesn't account for that on the Mac. Homebrew installed GRASS here: /usr/local/opt/grass7/grass-7.2.2/

#2 Updated by Alexander Bruy over 2 years ago

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

#3 Updated by Gary Sherman over 2 years ago

  • Status changed from Closed to Reopened

Different error but still related to GRASS detection:

NameError: name 'operator' is not defined 
Traceback (most recent call last):
  File "/Users/gsherman/apps/QGIS.app/Contents/MacOS/../Resources/python/qgis/utils.py", line 345, in startPlugin
    plugins[packageName].initGui()
  File "/Users/gsherman/apps/QGIS.app/Contents/MacOS/../Resources/python/plugins/processing/ProcessingPlugin.py", line 179, in initGui
    self.toolbox = ProcessingToolbox()
  File "/Users/gsherman/apps/QGIS.app/Contents/MacOS/../Resources/python/plugins/processing/gui/ProcessingToolbox.py", line 94, in __init__
    self.fillTree()
  File "/Users/gsherman/apps/QGIS.app/Contents/MacOS/../Resources/python/plugins/processing/gui/ProcessingToolbox.py", line 318, in fillTree
    self.fillTreeUsingProviders()
  File "/Users/gsherman/apps/QGIS.app/Contents/MacOS/../Resources/python/plugins/processing/gui/ProcessingToolbox.py", line 373, in fillTreeUsingProviders
    self.addAlgorithmsFromProvider(provider, self.algorithmTree.invisibleRootItem())
  File "/Users/gsherman/apps/QGIS.app/Contents/MacOS/../Resources/python/plugins/processing/gui/ProcessingToolbox.py", line 458, in addAlgorithmsFromProvider
    for group, groupItem in sorted(groups.items(), key=operator.itemgetter(1)):
NameError: name 'operator' is not defined

There is no Processing menu item after closing the error dialog on startup.

  • Homebrew installs grass7 in: /usr/local/opt/grass7
  • /usr/local/opt/grass7/grass-base is a symlink to /usr/local/opt/grass7/grass-7.2.2
  • The grass72 shell script is in /usr/local/opt/grass7/bin/grass72
  • /usr/local/opt/grass7/grass-base contains grass.sh and grass72.sh
  • /usr/local/opt/grass7/grass-base/bin contains all the grass function executables (e.g. r.in.gdal, v.in.ogr)
  • which grass72 returns: /usr/local/bin/grass72

#4 Updated by Alexander Bruy over 2 years ago

I don't see anything related to GRASS provider in the stacktrace. It is looks like completely different error.

#5 Updated by Alexander Bruy over 2 years ago

  • Status changed from Reopened to Closed

#6 Updated by Alexander Bruy over 2 years ago

  • Resolution set to fixed/implemented

And seems already fixed.

#7 Updated by Gary Sherman over 2 years ago

  • Status changed from Closed to Reopened

Clean build on a111a1c:

Couldn't load plugin 'processing' due to an error when calling its initGui() method 

PermissionError: [Errno 13] Permission denied: '/usr/local/opt/grass7/grass-7.2.2/etc/colors/grass' 
Traceback (most recent call last):
  File "/Users/gsherman/apps/QGIS.app/Contents/MacOS/../Resources/python/qgis/utils.py", line 345, in startPlugin
    plugins[packageName].initGui()
  File "/Users/gsherman/apps/QGIS.app/Contents/MacOS/../Resources/python/plugins/processing/ProcessingPlugin.py", line 179, in initGui
    self.toolbox = ProcessingToolbox()
  File "/Users/gsherman/apps/QGIS.app/Contents/MacOS/../Resources/python/plugins/processing/gui/ProcessingToolbox.py", line 95, in __init__
    self.fillTree()
  File "/Users/gsherman/apps/QGIS.app/Contents/MacOS/../Resources/python/plugins/processing/gui/ProcessingToolbox.py", line 319, in fillTree
    self.fillTreeUsingProviders()
  File "/Users/gsherman/apps/QGIS.app/Contents/MacOS/../Resources/python/plugins/processing/gui/ProcessingToolbox.py", line 384, in fillTreeUsingProviders
    providerItem = TreeProviderItem(provider, self.algorithmTree, self)
  File "/Users/gsherman/apps/QGIS.app/Contents/MacOS/../Resources/python/plugins/processing/gui/ProcessingToolbox.py", line 515, in __init__
    self.setToolTip(0, self.provider.longName())
  File "/Users/gsherman/apps/QGIS.app/Contents/MacOS/../Resources/python/plugins/processing/algs/grass7/Grass7AlgorithmProvider.py", line 125, in longName
    version = Grass7Utils.installedVersion()
  File "/Users/gsherman/apps/QGIS.app/Contents/MacOS/../Resources/python/plugins/processing/algs/grass7/Grass7Utils.py", line 115, in installedVersion
    startupinfo=si if isWindows() else None
  File "/usr/local/opt/python3/Frameworks/Python.framework/Versions/3.6/lib/python3.6/subprocess.py", line 709, in __init__
    restore_signals, start_new_session)
  File "/usr/local/opt/python3/Frameworks/Python.framework/Versions/3.6/lib/python3.6/subprocess.py", line 1344, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
PermissionError: [Errno 13] Permission denied: '/usr/local/opt/grass7/grass-7.2.2/etc/colors/grass'

#8 Updated by Alexander Bruy over 2 years ago

  • Status changed from Reopened to Closed

Already reported, see #17555

Also available in: Atom PDF