[GIS] “Couldn’t load PyQGIS” Error running QGIS on Ubuntu 14.04

installationpyqgisqgisUbuntu

I have installed QGis on Ubuntu 14.04 from the QGis stable repository; it went fine with no errors reported. But when I launch QGis I get this huge window with the following message:

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

Traceback (most recent call last):
File "", line 1, in
File
"/usr/lib/python2.7/dist-packages/qgis/init.py", line 35, in

from qgis.core import QgsFeature, QgsGeometry
ImportError: /usr/lib/python2.7/dist-packages/qgis/core.so: undefined symbol:
_ZN16QgsComposerShape12setSceneRectERK6QRectF

Python version:
2.7.6 (default, Mar 22 2014, 23:03:41) [GCC 4.8.2]

QGIS version:
2.2.0-Valmiera 'Valmiera', exported

Python path:
['/usr/share/qgis/python',
u'/home/desousa/.qgis2/python',
u'/home/desousa/.qgis2/python/plugins',
'/usr/share/qgis/python/plugins',
'/usr/local/lib/python2.7/dist-packages/MapScript-6.0.1-py2.7-linux-x86_64.egg',
'/usr/local/lib/python2.7/dist-packages/virtualenv-1.8.4-py2.7.egg',
'/usr/local/lib/python2.7/dist-packages/pip-1.2.1-py2.7.egg',
'/usr/local/lib/python2.7/dist-packages/pytz-2012j-py2.7.egg',
'/usr/local/lib/python2.7/dist-packages/python_dateutil-2.1-py2.7.egg',
'/usr/local/lib/python2.7/dist-packages/six-1.3.0-py2.7.egg',
'/usr/lib/grass64/etc/python/grass/script', '/usr/lib/grass64/etc',
'/usr/lib/grass64/etc/python', '/usr/lib/grass64/lib',
'/usr/lib/grass64/bin', '/usr/lib/grass64/scripts',
'/usr/lib/python2.6', '/home/desousa/Eclipse/Workspace.Tudor/OWSLib',
'/usr/lib/python2.7', '/usr/lib/python2.7/plat-x86_64-linux-gnu',
'/usr/lib/python2.7/lib-tk', '/usr/lib/python2.7/lib-old',
'/usr/lib/python2.7/lib-dynload',
'/usr/local/lib/python2.7/dist-packages',
'/usr/lib/python2.7/dist-packages',
'/usr/lib/python2.7/dist-packages/PILcompat',
'/usr/lib/python2.7/dist-packages/gst-0.10',
'/usr/lib/python2.7/dist-packages/gtk-2.0',
'/usr/lib/pymodules/python2.7',
'/usr/lib/python2.7/dist-packages/ubuntu-sso-client',
'/usr/lib/python2.7/dist-packages/wx-2.8-gtk2-unicode']

The packages I have installed:

$ dpkg -l | grep qgis
ii  libqgis2.2.0                                          2.2.0-1~precise1                                    amd64        QGIS - shared libraries
ii  python-qgis                                           2.2.0-3+trusty1                                     amd64        Python bindings to QGIS
ii  python-qgis-common                                    2.2.0-3+trusty1                                     all          Python bindings to QGIS - architecture-independent files
ii  qgis                                                  2.2.0-3+trusty1                                     amd64        Geographic Information System (GIS)
ii  qgis-common                                           2.2.0-3+trusty1                                     all          QGIS - architecture-independent data
ii  qgis-plugin-globe                                     2.2.0-3+trusty1                                     amd64        OSG globe plugin for QGIS
ii  qgis-plugin-globe-common                              2.2.0-3+trusty1                                     all          OSG GLOBE plugin for QGIS - architecture-independent data
ii  qgis-plugin-grass                                     2.2.0-3+trusty1                                     amd64        GRASS plugin for QGIS
ii  qgis-plugin-grass-common                              2.2.0-3+trusty1                                     all          GRASS plugin for QGIS - architecture-independent data
ii  qgis-providers                                        2.2.0-3+trusty1                                     amd64        collection of data providers to QGIS
ii  qgis-providers-common                                 2.2.0-3+trusty1                                     all          collection of data providers to QGIS - architecture-independent files

Best Answer

The package list notes:

Package: libqgis2.2.0
Source: qgis
Version: 2.2.0-3+trusty1
Architecture: amd64

which is not what your listing says. So either the package is broken, or your installation failed.

The package files are available at the QGis web site.

A precise package might not run on trusty.

Related Question