7

I have installed QGIS 2.8 - Wien on Linux Red Hat 7. Unfortunately when I start the application I got this python error:

{Couldn't load plugin 'processing' from ['/usr/share/qgis/python', '/home/qgisosr/.qgis2/python', '/home/qgisosr/.qgis2/python/plugins', '/usr/share/qgis/python/plugins', '/usr/lib64/python27.zip', '/usr/lib64/python2.7', '/usr/lib64/python2.7/plat-linux2', '/usr/lib64/python2.7/lib-tk', '/usr/lib64/python2.7/lib-old', '/usr/lib64/python2.7/lib-dynload', '/usr/lib64/python2.7/site-packages', '/usr/lib64/python2.7/site-packages/gtk-2.0', '/usr/lib64/python2.7/site-packages/wx-2.8-gtk2-unicode', '/usr/lib/python2.7/site-packages', '/home/qgisosr/.qgis2//python', '/usr/share/qgis/python/plugins/fTools/tools']


Traceback (most recent call last):
  File "/usr/lib64/python2.7/site-packages/qgis/utils.py", line 196, in loadPlugin
    __import__(packageName)
  File "/usr/lib64/python2.7/site-packages/qgis/utils.py", line 478, 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/lib64/python2.7/site-packages/qgis/utils.py", line 478, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "/usr/share/qgis/python/plugins/processing/tools/general.py", line 28, in 
    from processing.core.Processing import Processing
  File "/usr/lib64/python2.7/site-packages/qgis/utils.py", line 478, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "/usr/share/qgis/python/plugins/processing/core/Processing.py", line 44, in 
    from processing.gui.Postprocessing import handleAlgorithmResults
  File "/usr/lib64/python2.7/site-packages/qgis/utils.py", line 478, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "/usr/share/qgis/python/plugins/processing/gui/Postprocessing.py", line 36, in 
    from processing.gui.ResultsDialog import ResultsDialog
  File "/usr/lib64/python2.7/site-packages/qgis/utils.py", line 478, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "/usr/share/qgis/python/plugins/processing/gui/ResultsDialog.py", line 33, in 
    from processing.ui.ui_DlgResults import Ui_DlgResults
  File "/usr/lib64/python2.7/site-packages/qgis/utils.py", line 478, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "/usr/share/qgis/python/plugins/processing/ui/ui_DlgResults.py", line 61, in 
    from QtWebKit.QWebView import QWebView
  File "/usr/lib64/python2.7/site-packages/qgis/utils.py", line 478, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
ImportError: No module named QtWebKit.QWebView

Python version: 2.7.5 (default, Feb 11 2014, 07:46:25) [GCC 4.8.2 20140120 (Red Hat 4.8.2-13)]

QGIS version: 2.8.1-Wien Wien, exported

Python path: ['/usr/share/qgis/python', u'/home/qgisosr/.qgis2/python', u'/home/qgisosr/.qgis2/python/plugins', '/usr/share/qgis/python/plugins', '/usr/lib64/python27.zip', '/usr/lib64/python2.7', '/usr/lib64/python2.7/plat-linux2', '/usr/lib64/python2.7/lib-tk', '/usr/lib64/python2.7/lib-old', '/usr/lib64/python2.7/lib-dynload', '/usr/lib64/python2.7/site-packages', '/usr/lib64/python2.7/site-packages/gtk-2.0', '/usr/lib64/python2.7/site-packages/wx-2.8-gtk2-unicode', '/usr/lib/python2.7/site-packages', u'/home/qgisosr/.qgis2//python', '/usr/share/qgis/python/plugins/fTools/tools']}

I his close and QGIS stars. If I try to launch Python console I get this error:

{Failed to open Python console:

Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/lib64/python2.7/site-packages/qgis/utils.py", line 478, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "/usr/share/qgis/python/console/__init__.py", line 26, in 
    from console import show_console
  File "/usr/lib64/python2.7/site-packages/qgis/utils.py", line 478, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "/usr/share/qgis/python/console/console.py", line 29, in 
    from console_settings import optionsDialog
  File "/usr/lib64/python2.7/site-packages/qgis/utils.py", line 478, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "/usr/share/qgis/python/console/console_settings.py", line 24, in 
    from console_compile_apis import PrepareAPIDialog
  File "/usr/lib64/python2.7/site-packages/qgis/utils.py", line 478, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "/usr/share/qgis/python/console/console_compile_apis.py", line 28, in 
    from ui_console_compile_apis import Ui_APIsDialogPythonConsole
  File "/usr/lib64/python2.7/site-packages/qgis/utils.py", line 478, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "/usr/share/qgis/python/console/ui_console_compile_apis.py", line 70, in 
    from Qsci.qsciscintilla import QsciScintilla
  File "/usr/lib64/python2.7/site-packages/qgis/utils.py", line 478, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
ImportError: No module named Qsci.qsciscintilla

Python version: 2.7.5 (default, Feb 11 2014, 07:46:25) [GCC 4.8.2 20140120 (Red Hat 4.8.2-13)]

QGIS version: 2.8.1-Wien 'Wien', exported

Python path: ['/usr/share/qgis/python', u'/home/qgisosr/.qgis2/python', u'/home/qgisosr/.qgis2/python/plugins', '/usr/share/qgis/python/plugins', '/usr/lib64/python27.zip', '/usr/lib64/python2.7', '/usr/lib64/python2.7/plat-linux2', '/usr/lib64/python2.7/lib-tk', '/usr/lib64/python2.7/lib-old', '/usr/lib64/python2.7/lib-dynload', '/usr/lib64/python2.7/site-packages', '/usr/lib64/python2.7/site-packages/gtk-2.0', '/usr/lib64/python2.7/site-packages/wx-2.8-gtk2-unicode', '/usr/lib/python2.7/site-packages', u'/home/qgisosr/.qgis2//python', '/usr/share/qgis/python/plugins/fTools/tools']}

Anybody had this issue?

5
  • The first error states that QtWebKit.QWebView is missing. Try to install the QtWebKit package (or QWebView). The second error is similiar, Qsci.qsciscintilla is missing.
    – luca76
    Commented Jun 11, 2015 at 7:46
  • Is your Red Hat version Enterprise (RHEL)?
    – xunilk
    Commented Jun 11, 2015 at 9:57
  • If your answer is yes, you can see in this link: qgis.org/en/site/forusers/… that "Python support is strongly limited due to old dependencies. Note: It requires, that ELGIS and EPEL are also installed.".
    – xunilk
    Commented Jun 11, 2015 at 10:10
  • Hi Luca, I have installed qtwebkit and yum search qtwebkit Loaded plugins: langpacks, product-id, subscription-manager ============================ N/S matched: qtwebkit ============================= qtwebkit-devel.x86_64 : Development files for qtwebkit qtwebkit.x86_64 : Qt WebKit bindings
    – Marian
    Commented Jun 16, 2015 at 21:50
  • ANswer for xunlink. Yes I did all installations. I still get the error.
    – Marian
    Commented Jun 16, 2015 at 21:51

2 Answers 2

4

A alternative quick fix (without having to edit the QGIS source) may be to just add dummy modules somewhere on the QGIS python path, e.g.

mkdir QtWebKit Qsci
touch QtWebKit/__init__.py Qsci/__init__.py
echo "from PyQt4.QtWebKit import QWebView" > QtWebKit/QWebView.py
echo "from PyQt4.Qsci import QsciScintilla" > Qsci/qsciscintilla.py

The python path is given when QGIS shows the error. For example:

~/.qgis2/python  # specific to individual user(s)

or

/usr/share/qgis/python  # requires sudo to edit
1
  • 1
    On Centos 7.2, I had to install PyQt4-webkit.x86_64. Thanks @isedwards Commented Oct 8, 2016 at 9:55
3

I have found the solution of the issue. I checked ui_DlgResults.py file from /usr/share/qgis/python/plugins/processing/ui/ and I have found that QWebView is not imported correctly. In the file was: from QtWebKit.QWebView import QWebView I have replace with from PyQt4.QtWebKit import QWebView and recompile the script using py_compiler. The error is gone. In addition there are other 3 python scripts with the same error: - ui_DlgGetScriptsAndModels.py - ui_DlgHelpEdition.py - ui_DlgAlgorithmBase.py I have changed all files and recompile them using py_compiler.

For the second error when I tried to start the Python script the error was in the file ui_console_compile_apis.py from /usr/share/qgis/python/console/. I have replaced from Qsci.qsciscintilla import QsciScintilla with from PyQt4.Qsci import QsciScintilla. Now QGIS works. I have also notified QGIS project about the changes on their code. Unfortunately I did not get any answer from them.

3
  • I have the same issue on CentOS7. Which is the URL to your bug report? thanks
    – markusN
    Commented Sep 18, 2015 at 6:47
  • I do not get your question. I have reported the bug to [email protected]. I do not know what was their resolution.
    – Marian
    Commented Sep 21, 2015 at 12:50
  • I see - did anyone respond? The other option is to report at the bugtracker of QGIS: hub.qgis.org/projects/quantum-gis
    – markusN
    Commented Sep 21, 2015 at 18:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.