Missing modules for paramiko and gio in duplicity foo

Since I upgraded some of my servers to the latest LTS of Ubuntu, I saw nice warning messages in my duplicity backup reports. I know, these are just warnings and no errors, but I don’t like to see any warning in a backup report of mine. Here is a sample:

Import of duplicity.backends.giobackend Failed: No module named gio
Import of duplicity.backends.sshbackend Failed: No module named paramiko

The paramiko problem was resolved easily by installing the python-paramiko package. The gio warning was not so easy to find. But after some digging I found the culprit in python-gobject-2. The following command line fixes the above warnings on a Debian based distribution:

apt-get install python-paramiko python-gobject-2