6

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./

9

Little workaround found here:

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

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

| improve this answer | |
  • 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 '13 at 20:26
1

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

#!/usr/bin/python2

Now it works

| improve this answer | |
  • This is what worked for me. – Richard Irons Sep 19 '19 at 12:28
0

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.

| improve this answer | |

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.