Bug #4444

Error when loading Python plugins

Added by Vaclav Petras over 1 year ago. Updated over 1 year ago.

Status:Closed Start Date:10/26/2011
Priority:Low Due date:
Assigned to:- % Done:

0%

Category:Python plugins and bindings
Target version:-
Platform: Patch supplied:Yes
Platform version: Affected version:master
Status info: Causes crash or corruption:No
Resolution:fixed

Description

On QGIS start-up Python error has occurred.
Message from Python error window:

Couldn't load plugin '' from ['/home/vasek/dev/qgis/Quantum-GIS/build-master/output/bin/../python', '/home/vasek/.qgis/python', '/home/vasek/.qgis/python/plugins', '', '/usr/lib/python2.6', '/usr/lib/python2.6/plat-linux2', '/usr/lib/python2.6/lib-tk', '/usr/lib/python2.6/lib-old', '/usr/lib/python2.6/lib-dynload', '/usr/lib/python2.6/dist-packages', '/usr/lib/python2.6/dist-packages/PIL', '/usr/lib/python2.6/dist-packages/gst-0.10', '/usr/lib/pymodules/python2.6', '/usr/lib/python2.6/dist-packages/gtk-2.0', '/usr/lib/pymodules/python2.6/gtk-2.0', '/usr/lib/python2.6/dist-packages/wx-2.8-gtk2-unicode', '/usr/local/lib/python2.6/dist-packages']

Traceback (most recent call last):
  File "/home/vasek/dev/qgis/Quantum-GIS/build-master/output/bin/../python/qgis/utils.py", line 117, in loadPlugin
    __import__(packageName)
  File "/home/vasek/dev/qgis/Quantum-GIS/build-master/output/bin/../python/qgis/utils.py", line 283, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
ValueError: Empty module name

Python version:
2.6.5 (r265:79063, Apr 16 2010, 14:15:55) 
[GCC 4.4.3]

QGIS version:
1.8.0-Trunk Trunk, a8a90fe

Python path: ['/home/vasek/dev/qgis/Quantum-GIS/build-master/output/bin/../python', '/home/vasek/.qgis/python', '/home/vasek/.qgis/python/plugins', '', '/usr/lib/python2.6', '/usr/lib/python2.6/plat-linux2', '/usr/lib/python2.6/lib-tk', '/usr/lib/python2.6/lib-old', '/usr/lib/python2.6/lib-dynload', '/usr/lib/python2.6/dist-packages', '/usr/lib/python2.6/dist-packages/PIL', '/usr/lib/python2.6/dist-packages/gst-0.10', '/usr/lib/pymodules/python2.6', '/usr/lib/python2.6/dist-packages/gtk-2.0', '/usr/lib/pymodules/python2.6/gtk-2.0', '/usr/lib/python2.6/dist-packages/wx-2.8-gtk2-unicode', '/usr/local/lib/python2.6/dist-packages']

Three last debug messages from console:
Debug: /home/vasek/dev/qgis/Quantum-GIS/src/app/qgspluginregistry.cpp: 463: (checkCppPlugin) Failed to get name, description, or type for /home/vasek/dev/qgis/Quantum-GIS/build-master/output/bin/../lib/qgis/plugins/libwfsprovider.so
Debug: /home/vasek/dev/qgis/Quantum-GIS/src/app/qgspluginregistry.cpp: 463: (checkCppPlugin) Failed to get name, description, or type for /home/vasek/dev/qgis/Quantum-GIS/build-master/output/bin/../lib/qgis/plugins/libwmsprovider.so
Debug: /home/vasek/dev/qgis/Quantum-GIS/src/app/qgspluginregistry.cpp: 413: (restoreSessionPlugins) Loading python plugins

When Python list available_plugins is empty output QString from evalString is empty. Method split returns QStringList with one empty string, not empty list as expected, because default option is KeepEmptyParts. This plugin with name "" is now in list of available plugins.

The solution is call split with proper parameter, it is SkipEmptyParts (see diff).

It is harmless error. However it is not nice when it is first thing you see when you start QGIS with no Python plugins.

qgis_loading_python_plugins.diff - path (817 Bytes) Vaclav Petras, 10/26/2011 12:49 am

History

Updated by Robin Lovelace over 1 year ago

I'm having a similar problem in 1.7.1 (updated just now): when qgis loads I get this complaint:

Warning: loading of qgis translation failed [/usr/share/qgis/i18n//qgis_en_GB]
Warning: loading of qt translation failed [/usr/share/qt4/translations/qt_en_GB]
Warning: Couldn't load Python support library: Cannot load library /usr/lib/qgispython: (/usr/lib/libqgispython.so: cannot open shared object file: No such file or directory)

I've seen this ticketed elsewhere (here http://trac.osgeo.org/qgis/ticket/2882 ) but I don't know how to include the patch in my install. Is a fresh install a possible solution?

Updated by Robin Lovelace over 1 year ago

P.S. I'm running Oneric 64 bit.

Updated by Giovanni Manghi over 1 year ago

Robin Lovelace wrote:

P.S. I'm running Oneric 64 bit.

There are no problems under Oneiric 64bit (I'm using it too), you just probably have some conflict with and old installation/repo. Try purge everything qgis related and re-install again.

Updated by Martin Dobias over 1 year ago

Patch applied in d8dc04f - thanks for contributing it.

Robin: your problem is unrelated, your installation may be incorrect.

Updated by Martin Dobias over 1 year ago

  • Status changed from New to Closed
  • Resolution set to fixed

Also available in: Atom PDF