3

I just upgraded from Ubuntu GNOME 16.04 to 16.10, then I cannot run software-properties-gtk.

Output of that command is:

Traceback (most recent call last):
  File "/usr/bin/software-properties-gtk", line 37, in <module>
    from softwareproperties.gtk.SoftwarePropertiesGtk import SoftwarePropertiesGtk
  File "/usr/lib/python3/dist-packages/softwareproperties/gtk/SoftwarePropertiesGtk.py", line 34, in <module>
    from aptdaemon import client
  File "/usr/lib/python3/dist-packages/aptdaemon/client.py", line 43, in <module>
    import defer
ImportError: No module named 'defer'

This means that all other programs relying on aptd are throwing errors.

I have tried reinstalling the package python-defer which proceeded without any errors but that did not correct this problem.

Any suggestions what went wrong? Thanks!

Majal
  • 7,613
  • 4
  • 28
  • 43
  • 1
    Check if you installed `defer` for different python versions. If i remember correctly, you can either use `pip2 install` or `pip3 install`. – thuyein Oct 17 '16 at 12:16
  • Works perfect! Thank you. I did `sudo pip install defer`. You may wish to post this as an answer. I have one question though. Why wouldn't the installed `python-defer` package work, while pip install works? – Majal Oct 17 '16 at 12:20
  • Looks like `software-properties-gtk` is looking inside `dist-packages` for Python 3, so you probably need to do `sudo apt install python3-defer`. – edwinksl Oct 17 '16 at 12:35
  • @Majal I think when you install `python-defer` it actually installs into python2 site-packages. But usually `pip` is mapped to the highest python version. So `pip install defer` installed it for python3. And apparently that `/usr/bin/software-properties-gtk` uses python3. – thuyein Oct 17 '16 at 12:46

1 Answers1

2

Check if you installed defer for different python versions. If i remember correctly, you can either use pip2 install defer or pip3 install defer

thuyein
  • 206
  • 1
  • 9
  • I've actually quite noticed that similar things had been occurring since the move from python2.x to python3.x... Thanks! – Majal Oct 17 '16 at 13:10
  • Yeah I also learn python. And I have both versions installed, and a bunch of virtualenvs. The safest way to install the package in correct version is to specify the version name in pip. `pip2` or `pip3`. And some packages in ubuntu's repository have similar naming schemes, `python2-` or `python-` or `python3-` prefixes. – thuyein Oct 17 '16 at 13:17