[GIS] Couldn’t load plugin ‘processing’ – name ‘QsciLexerCustom’ is not defined – Manjaro

errorpythonqgisqgis-processing

I receive the following error when I start QGIS:

Couldn't load plugin 'processing' from ['/usr/share/qgis/python', '/home/v/.qgis2/python', '/home/v/.qgis2/python/plugins', '/usr/share/qgis/python/plugins', '/usr/lib/python27.zip', '/usr/lib/python2.7', '/usr/lib/python2.7/plat-linux2', '/usr/lib/python2.7/lib-tk', '/usr/lib/python2.7/lib-old', '/usr/lib/python2.7/lib-dynload', '/usr/lib/python2.7/site-packages', '/usr/lib/python2.7/site-packages/gst-0.10', '/usr/lib/python2.7/site-packages/gtk-2.0', '/usr/lib/python2.7/site-packages/wx-3.0-gtk2', '/home/v/.qgis2/python/plugins/mmqgis/forms', '/usr/share/qgis/python/plugins/fTools/tools']

Traceback (most recent call last):
File "/usr/share/qgis/python/qgis/utils.py", line 182, in loadPlugin
__import__(packageName)
File "/usr/share/qgis/python/qgis/utils.py", line 453, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
File "/usr/share/qgis/python/plugins/processing/__init__.py", line 29, in 
from processing.tools.general import *
File "/usr/share/qgis/python/qgis/utils.py", line 453, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
File "/usr/share/qgis/python/plugins/processing/tools/general.py", line 29, in 
from processing.core.Processing import Processing
File "/usr/share/qgis/python/qgis/utils.py", line 453, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
File "/usr/share/qgis/python/plugins/processing/core/Processing.py", line 55, in 
from processing.r.RAlgorithmProvider import RAlgorithmProvider
File "/usr/share/qgis/python/qgis/utils.py", line 453, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
File "/usr/share/qgis/python/plugins/processing/r/RAlgorithmProvider.py", line 34, in 
from processing.gui.EditScriptAction import EditScriptAction
File "/usr/share/qgis/python/qgis/utils.py", line 453, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
File "/usr/share/qgis/python/plugins/processing/gui/EditScriptAction.py", line 29, in 
from processing.gui.ScriptEditorDialog import ScriptEditorDialog
File "/usr/share/qgis/python/qgis/utils.py", line 453, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
File "/usr/share/qgis/python/plugins/processing/gui/ScriptEditorDialog.py", line 42, in 
from processing.gui.ScriptEdit import ScriptEdit
File "/usr/share/qgis/python/qgis/utils.py", line 453, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
File "/usr/share/qgis/python/plugins/processing/gui/ScriptEdit.py", line 36, in 
from processing.gui.LexerR import LexerR
File "/usr/share/qgis/python/qgis/utils.py", line 453, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
File "/usr/share/qgis/python/plugins/processing/gui/LexerR.py", line 34, in 
class LexerR(QsciLexerCustom):
NameError: name 'QsciLexerCustom' is not defined

Python version:
2.7.6 (default, Feb 15 2014, 23:06:13) 
[GCC 4.8.2 20140206 (prerelease)]


QGIS version: 
2.3.0-Master Master, ccde1d4

Python path: ['/usr/share/qgis/python', u'/home/v/.qgis2/python', u'/home/v/.qgis2/python/plugins', '/usr/share/qgis/python/plugins', '/usr/lib/python27.zip', '/usr/lib/python2.7', '/usr/lib/python2.7/plat-linux2', '/usr/lib/python2.7/lib-tk', '/usr/lib/python2.7/lib-old', '/usr/lib/python2.7/lib-dynload', '/usr/lib/python2.7/site-packages', '/usr/lib/python2.7/site-packages/gst-0.10', '/usr/lib/python2.7/site-packages/gtk-2.0', '/usr/lib/python2.7/site-packages/wx-3.0-gtk2', '/home/v/.qgis2/python/plugins/mmqgis/forms', '/usr/share/qgis/python/plugins/fTools/tools']

First, I don't know anything about python, so forgive me if the information I provide is a bit random and don't hesitate to ask more.
I also do not know how to define something in python but at first sight and from my limited understanding, it seemed pretty well defined:

Indeed, in /usr/share/qgis/python/plugins/processing/gui/ the LexerR.py file specifies:
from PyQt4.Qsci import *

In /usr/share/sip/PyQt4/Qsci/ there is a qscilexercustom.sip file specifying:
'#include'

and the file qscilexercustom.h exists in the /usr/include/qt4/Qsci/ folder.

I had QGIS 2.0 before, with the same issue, and installed this development version with the faint hope that it might solve my problem.
Would you have any idea how to solve this issue?


UPDATE

Here is what I get when I try to import PyQt4.Qsci:
RuntimeError: the sip module implements API v11.0 but the PyQt4.Qsci module requires API v10.1

So I guess now I'll try to downgrade sip, though I had to install sipdev to compile QGIS.


UPDATE 2

Downgrading sip wasn't such a good idea since it is required by PyQt4.
Here's is what I get when I try to launch QGIS:

Couldn't load PyQt4.
Python support will be disabled.


Traceback (most recent call last):
File "", line 1, in 
RuntimeError: the sip module implements API v10.0 to v10.1 but the PyQt4.QtCore module requires API v11.0

Same when I try to import PyQt4.Qsci from Python:

  RuntimeError: the sip module implements API v10.0 to v10.1 but the PyQt4.QtCore module requires API v11.0

Note that python-qscintilla, python-qscintilla-common, python2-qscintilla and qscintilla are all installed in version 2.8-1.

Any ideas?

Best Answer

The Processing plugin uses the Qsci.so module (Python binding for QScintilla2) for creating an embedded code editor widget. This is the same Qt code editor widget used for the PyQGIS (Python) Console.

While you may have QScintilla2 C++ lib installed, you may not have install its Python binding. Simply opening a Python console in your shell and issuing the following will tell you if it is available:

import PyQt4.Qsci 

If not install it. Not sure what package manager Manjaro uses, but for apt on Ubuntu, there is a separate python-qscintilla2 package.

Otherwise, you could install from source, if you want the latest.

Related Question