5

After I upgraded to Ubuntu 14.04 the dialog system-config-printer in gnome runs into problems when called from the command line:

sudo system-config-printer
Traceback (most recent call last):
  File "/usr/share/system-config-printer/system-config-printer.py", line 72, in <module>
    from gi.repository import GObject # for TYPE_STRING and TYPE_PYOBJECT
  File "/usr/lib/python2.7/dist-packages/gi/__init__.py", line 32, in <module>
    raise ImportError('When using gi.repository you must not import static '
ImportError: When using gi.repository you must not import static modules like "gobject". Please change all occurrences of "import gobject" to "from gi.repository import GObject".

The problem persisted when I tried to change the suggested imports in the package, i.e.,

cd /usr/share/system-config-printer
sed -i 's/import gobject/from gi.repository import GObject/g' *.py
sed -i 's/gobject/GObject/g' *.py

Thanks for your help.

alodi
  • 205

1 Answers1

3

Modifying system files is not a good idea, instead check first that you have the latest version of the corresponding package:

dpkg-query -W system-config-printer-gnome

It should return:

system-config-printer-gnome    1.4.3+20140219-0ubuntu2.1

Then try to re-install the package using apt-get:

sudo apt-get update
sudo apt-get install --reinstall system-config-printer-gnome