Bug report #4444

Error when loading Python plugins

Added by Vaclav Petras about 13 years ago. Updated about 13 years ago.

Status:Closed
Priority:Low
Assignee:-
Category:Python plugins
Affected QGIS version: Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:Yes Resolution:fixed
Crashes QGIS or corrupts data: Copied to github as #:14376

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 Magnifier - path (817 Bytes) Vaclav Petras, 2011-10-26 12:49 AM

Associated revisions

Revision d8dc04f5
Added by Martin Dobias about 13 years ago

Fix #4444. Patch by Vaclav Petras

Revision 73752e61
Added by Martin Dobias about 13 years ago

Fix #4444. Patch by Vaclav Petras

History

#1 Updated by Robin Lovelace about 13 years 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?

#2 Updated by Robin Lovelace about 13 years ago

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

#3 Updated by Giovanni Manghi about 13 years 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.

#4 Updated by Martin Dobias about 13 years ago

Patch applied in d8dc04f - thanks for contributing it.

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

#5 Updated by Martin Dobias about 13 years ago

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

Also available in: Atom PDF