Sunday, 6 August 2017

QGIS Semi-automatic classification plugin install error on OS X 10.10: matplotlib.backends.backend_qt4agg


I have tried repeatedly to install the QGIS Semi-automatic classification plugin via both (1) Plugins > Install & Manage Plugins and (2) manually based on other comments I found here, but I can't get it to work. I continue to get the error:



The plugin is broken. Python said:
No module named matplotlib.backends.backend_qt4agg

I have checked and have installed matplotlib, GDAL, scipy, numpy via macports (QGIS was installed via macports as well, but I have uninstalled, reinstalled, and rebooted a couple of times at this point).


I am not sure how else to proceed.



Answer



Matplotlib has many backends


In my Mac OS X matplotlib (1.4.2) installation, using the pure Python script in List of all available matplotlib backends the result is:


 print backends
['agg', 'cairo', 'cocoaagg', 'gdk', 'gtk', 'gtk3', 'gtk3agg', 'gtk3cairo', 'gtkagg', 'gtkcairo', 'macosx', 'mixed', 'nbagg', 'pdf', 'pgf', 'ps', 'qt4', 'qt4agg', 'qt5', 'qt5agg', 'svg', 'template', 'tkagg', 'webagg', 'webagg_core', 'wx', 'wxagg']


As you can see, there is a 'qt4agg' backend


As I use the default Apple Python, the backends files are in /Library/Python/2.7/site-packages/matplotlib-1.4.2/matplotlib/backends


enter image description here


So your matplotlib is not correctly installed or you PYTHONPATH is not correct. Look at Macports Ticket: py27-matplotlib say py27-pyqt4 not installed when using qt-backend


But why use MacPorts ? There are other solutions available, more reliable, KyngChaos or Homebrew, look at QGIS python location problem


No comments:

Post a Comment