homebrew-osgeo4mac: QGIS2 - could not load "processing" plugin

I installed qgis2 on Sierrra, and I get the following error when starting:

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

TypeError: coercing to Unicode: need string or buffer, NoneType found 
Traceback (most recent call last):
  File "/usr/local/Cellar/qgis2/2.18.2/QGIS.app/Contents/MacOS/../Resources/python/qgis/utils.py", line 333, in startPlugin
    plugins[packageName] = package.classFactory(iface)
  File "/usr/local/Cellar/qgis2/2.18.2/QGIS.app/Contents/MacOS/../Resources/python/plugins/processing/__init__.py", line 38, in classFactory
    return ProcessingPlugin(iface)
  File "/usr/local/Cellar/qgis2/2.18.2/QGIS.app/Contents/MacOS/../Resources/python/plugins/processing/ProcessingPlugin.py", line 58, in __init__
    Processing.initialize()
  File "/usr/local/Cellar/qgis2/2.18.2/QGIS.app/Contents/MacOS/../Resources/python/plugins/processing/core/Processing.py", line 148, in initialize
    Processing.addProvider(c())
  File "/usr/local/Cellar/qgis2/2.18.2/QGIS.app/Contents/MacOS/../Resources/python/plugins/processing/core/Processing.py", line 103, in addProvider
    % (provider.getDescription(), traceback.format_exc()))
  File "/usr/local/Cellar/qgis2/2.18.2/QGIS.app/Contents/MacOS/../Resources/python/plugins/processing/algs/saga/SagaAlgorithmProvider.py", line 123, in getDescription
    version = SagaUtils.getSagaInstalledVersion()
  File "/usr/local/Cellar/qgis2/2.18.2/QGIS.app/Contents/MacOS/../Resources/python/plugins/processing/algs/saga/SagaUtils.py", line 130, in getSagaInstalledVersion
    commands = [os.path.join(sagaPath(), "saga_cmd -v")]
  File "/usr/local/Cellar/qgis2/2.18.2/QGIS.app/Contents/MacOS/../Resources/python/plugins/processing/algs/saga/SagaUtils.py", line 75, in sagaPath
    if not os.path.isdir(folder):
  File "/usr/local/opt/python/Frameworks/Python.framework/Versions/2.7/lib/python2.7/genericpath.py", line 49, in isdir
    st = os.stat(s)
TypeError: coercing to Unicode: need string or buffer, NoneType found


Python version: 2.7.13 (default, Dec 18 2016, 07:03:39) [GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.42.1)] 
QGIS version: 2.18.2 Las Palmas, exported 

Python Path:
/usr/local/Cellar/qgis2/2.18.2/QGIS.app/Contents/MacOS/../Resources/python/plugins/processing
/usr/local/Cellar/qgis2/2.18.2/QGIS.app/Contents/MacOS/../Resources/python
/Users/rainerkrug/.qgis2/python
/Users/rainerkrug/.qgis2/python/plugins
/usr/local/Cellar/qgis2/2.18.2/QGIS.app/Contents/MacOS/../Resources/python/plugins
/usr/local/opt/python/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/geeknote-0.2a-py2.7.egg
/usr/local/opt/gdal2-python/lib/python2.7/site-packages
/usr/local/lib/qt-4/python2.7/site-packages
/usr/local/opt/qgis2/lib/python2.7/site-packages
/usr/local/lib/python2.7/site-packages
/usr/local/opt/python/Frameworks/Python.framework/Versions/2.7/lib/python27.zip
/usr/local/opt/python/Frameworks/Python.framework/Versions/2.7/lib/python2.7
/usr/local/opt/python/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-darwin
/usr/local/opt/python/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac
/usr/local/opt/python/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac/lib-scriptpackages
/usr/local/opt/python/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk
/usr/local/opt/python/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-old
/usr/local/opt/python/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload
/Users/rainerkrug/Library/Python/2.7/lib/python/site-packages
/usr/local/opt/python/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages
/usr/local/opt/python/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/geos
/usr/local/Cellar/matplotlib/1.5.1/libexec/lib/python2.7/site-packages
/usr/local/Cellar/numpy/1.11.2/libexec/nose/lib/python2.7/site-packages
/usr/local/opt/libxml2/lib/python2.7/site-packages
/usr/local/opt/python/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/gtk-2.0
/usr/local/lib/python2.7/site-packages/gtk-2.0
/usr/local/opt/python/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/wx-3.0-osx_cocoa
/Users/rainerkrug/.qgis2//python

The same happens if Y start from the wrapper script.

Any suggestions?

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 1
  • Comments: 33 (29 by maintainers)

Most upvoted comments

Hmm. This might be an issue with incorrect parsing of an antiquated QSetting value for macOS (ran into this recently).

Try:

  • Quit any running QGIS.app
  • Temporarily move ~/Library/Preferences/org.qgis.QGIS2.plist to your Desktop
  • Relaunch QGIS.app <-- see if error is gone
  • Quit QGIS.app
  • Overwrite ~/Library/Preferences/org.qgis.QGIS2.plist with the backup from Desktop

Please report if that works.

Also, looks like this is fixed in: https://github.com/qgis/QGIS/commit/4923e46

However, I think that fix masks the bad ‘leftover’ setting on macOS. If the workaround does work, then applying the fix and adding another should do the trick.