Bug report #20342

Grass7 processing plugin fails to activate on macOS

Added by Jonathan McCormack over 2 years ago. Updated over 2 years ago.

Affected QGIS version:3.4.0 Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:fixed/implemented
Crashes QGIS or corrupts data:No Copied to github as #:28163


In QGIS 3.4.1 (and 3.4.0) with GRASS 7.4.2 installed via the osgeo4mac homebrew tap on macOS 10.14, loading the 'processing' plugin errors out:

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

AttributeError: type object 'Grass7Utils' has no attribute 'checkGrass7IsInstalled' 
Traceback (most recent call last):
  File "/usr/local/Cellar/qgis3/3.4.1/QGIS.app/Contents/MacOS/../Resources/python/qgis/utils.py", line 344, in startPlugin
  File "/usr/local/Cellar/qgis3/3.4.1/QGIS.app/Contents/MacOS/../Resources/python/plugins/processing/ProcessingPlugin.py", line 181, in initGui
    self.toolbox = ProcessingToolbox()
  File "/usr/local/Cellar/qgis3/3.4.1/QGIS.app/Contents/MacOS/../Resources/python/plugins/processing/gui/ProcessingToolbox.py", line 93, in __init__
  File "/usr/local/Cellar/qgis3/3.4.1/QGIS.app/Contents/MacOS/../Resources/python/plugins/processing/gui/ProcessingToolbox.py", line 135, in disabledProviders
    if not provider.isActive() and provider.canBeActivated():
  File "/usr/local/Cellar/qgis3/3.4.1/QGIS.app/Contents/MacOS/../Resources/python/plugins/processing/algs/grass7/Grass7AlgorithmProvider.py", line 157, in canBeActivated
    return not bool(Grass7Utils.checkGrass7IsInstalled())
AttributeError: type object 'Grass7Utils' has no attribute 'checkGrass7IsInstalled'

Python version: 3.7.0 (default, Jul 23 2018, 20:22:55) [Clang 9.1.0 (clang-902.0.39.2)] 
QGIS version: 3.4.1-Madeira Madeira, exported

It appears that the file source:python/plugins/processing/algs/grass7/Grass7AlgorithmProvider.py#L157 still references the method 'checkGrass7IsInstalled' which was renamed to 'checkGrassIsInstalled' in the file source:python/plugins/processing/algs/grass7/Grass7Utils.py#459 as part of commit 6c81895

I'm not sure why I am only just now encountering this issue, whereas QGIS prior to 3.4.0 hadn't triggered this, but as best I can tell the method referenced in Grass7AlgorithmProvider.py just needs to be fixed to:

    def canBeActivated(self):
        return not bool(Grass7Utils.checkGrassIsInstalled())


#1 Updated by Giovanni Manghi over 2 years ago

  • Easy fix? changed from Yes to No
  • Subject changed from Grass7 processing plugin fails to activate to Grass7 processing plugin fails to activate on macOS

#2 Updated by Alexander Bruy over 2 years ago

  • Resolution set to fixed/implemented
  • Operating System deleted (macOS 10.14)
  • Status changed from Open to Closed

Fixed in master. Please reopen if necessary.

Also available in: Atom PDF