2

I have a broken package that is preventing QGIS from loading python plugins, updating itself, or even un-installing.

The main symptom of this problem is the following message that appears when QGIS is booted:

error message

QGIS works, but none of the python plugins do and I cannot update, reinstall or uninstall QGIS. The paths of action I have tried so far are:

  • Reinstall PyQGIS (which I believe to be causing the problem) using Synaptic, which leads to this error:

Synaptic error message

  • Updating the packages and reinstalling, using `sudo apt-get update

sudo apt-get upgrade`,

This leads to the following error:

dpkg: error processing python-qgis (--configure): dependency problems - leaving unconfigured No apport report written because the error message indicates it's a follow-up error from a previous failure. Errors were encountered while processing: python-qgis-common python-qgis E: Sub-process /usr/bin/dpkg returned an error code (1)

  • Following advice from here on broken packages, forced install sudo apt-get install -f and sudo dpkg --configure -a.

The latter option flags the following error, which tells me (more or less) what the problem is, but not how to solve it:

dpkg: dependency problems prevent configuration of python-qgis: python-qgis depends on python-qgis-common (= 1.9.0+git20121201+80fa7aa~precise1); however: Package python-qgis-common is not configured yet. dpkg: error processing python-qgis (--configure): dependency problems - leaving unconfigured Errors were encountered while processing: python-qgis-common python-qgis

How do I solve this so I can have a fully working version of QGIS again?

3
  • 1
    Not a solution for you, but I have just hit exactly the same issue. There seems to be an error setting up the Sextante plugin on the nightly build. Setting up python-qgis-common (1.9.0+git20121201+80fa7aa~precise-ubuntugis1) ... Compiling /usr/share/qgis/python/plugins/sextante/admintools/httplib2/__init__.py ... SyntaxError: ('from future imports must occur at the beginning of the file', ('/usr/share/qgis/python/plugins/sextante/admintools/httplib2/__init__.py', 26, None, 'from future import generators\n')) There are work arounds that I will try to get my QGIS back up, but it looks as
    – user13299
    Commented Dec 4, 2012 at 0:42
  • Does running sudo apt-get check provide any more detail?
    – RomaH
    Commented Dec 4, 2012 at 0:54
  • Hi RomaH, no more details, it just says:Reading package lists... Done Building dependency tree Reading state information... Done Commented Dec 4, 2012 at 9:31

2 Answers 2

4

I had the same problem today, and maybe a solution that will work for you as well.

The error occurs in the file:

/usr/share/qgis/python/plugins/sextante/admintools/httplib2/__init__.py

(NOTE: I'm running on Linux, for me the qgis share is installed in /usr/hare, but it could be another directory for you).

As root or with sufficient privileges, open the file in an editor. Now move the following line:

from __future__ import generators

above the line starting with:

__author__

Save the file.

Now in Synaptic package manager I reinstalled python-qgis and python-qgis-common. Now the problem was solved.

I'll report this to the QGIs devs as well, but hope this helps for now.

3
  • I modified init.py as you suggested and that allowed python-qgis packages to be reinstalled. Great solution, so far. How did you figure that out? Had error after this: /home/robin/.qgis//python/plugins/gmap_overview_plugin/gmap_gui.py:134: RuntimeWarning: divide by zero encountered in divide zoom = np.abs((np.array(zooms) - scale)/scale) Commented Dec 4, 2012 at 9:47
  • 1
    Happy it worked out well. The error log pointed to the file and so I took a look at it and tried it. That worked right away :). In the QGis source code I noticed that the statement seems to be fixed already. Commented Dec 4, 2012 at 10:06
  • Great work - got my QGIS up and running again, although will stick to qgis 1.8.0~precise1 for a while now for stability. Notice the new labelling feature has not yet been incorporated in the stable release, so may go back to 1.9 at some point. Good news that the problem's been resolved. Commented Dec 4, 2012 at 10:14
2

It sounds like a problem with the python-qgis-common package just try removing it with the --purge option and then reinstalling you might have to wrestle with dependencies, though it doesn't sound like anything that depends on it is installing.

If you ultimately cannot get it to work you might need to purge everything from your system and reinstall. Then run sudo apt-get remove --purge qgis This should remove qgis, all it dependencies that are not needed elsewhere, and all configuration files except the ones in your home folder (I think, they should be at ~/.qgis and ~/.config/QuantumGIS). You can also do this via Synaptic via the Removal All on your check-boxes.

This should reset everything as it was before package install.

If you installed from source, and you still have your source files you can run make uninstall this should do about the same as above but won't touch your dependencies or any configuration files(?).

Next time if installing from source use the checkinstall package it will neatly make a *.deb file from your source and can use aptitude to manage your packages.

**Be warned I am not using 1.9

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.