I am using Ubuntu 11.10 with Gnome Shell and have a problem with gnome-tweak-tool. When I click on it, it does nothing and when I try to open with terminal it gives this error:

Traceback (most recent call last):
File "/usr/bin/gnome-tweak-tool", line 22, in <module>
import gi
ImportError: No module named gi

I googled a bit, found some solutions (reinstalled some python-gobject packages), but still didn't help./

3 Answers 3


Little workaround found here:

sudo nano /usr/bin/gnome-tweak-tool

Change #!/usr/bin/env python to #!/usr/bin/python

  • Should have known to do this already, had the same problem with diffuse. Not sure why installed "binaries" seem to be so deferential towards using the current env Python.
    – Nick T
    Nov 25, 2013 at 20:26

My file is named 'gnome-tweaks' BTW, and it was already #!/usr/bin/python I solved my crisis by realizing that I've recently installed python3 along side python2 and set it to default. [[ python -> python3 ]]

I changed my line to


Now it works

  • This is what worked for me. Sep 19, 2019 at 12:28

I got this error after messing with pyenv. I changed system python to one from pyenv so system could not find modules installed for system python. pyenv global system fixed the error.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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