Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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?

share|improve this question
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 Dec 4 '12 at 0:42
    
Does running sudo apt-get check provide any more detail? –  RomaH Dec 4 '12 at 0:54
    
Hi RomaH, no more details, it just says:Reading package lists... Done Building dependency tree Reading state information... Done –  RobinLovelace Dec 4 '12 at 9:31
add comment

2 Answers

up vote 3 down vote accepted

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.

share|improve this answer
    
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) –  RobinLovelace Dec 4 '12 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. –  Thijs Brentjens Dec 4 '12 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. –  RobinLovelace Dec 4 '12 at 10:14
add comment

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

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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