Wednesday 21 December 2016

How to fix QGIS PyQGIS package?



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?



Answer



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.


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...