Cinnamon: Cinnamon Settings does not show because of import error of gi.repository

Created on 9 Jul 2015  路  10Comments  路  Source: linuxmint/cinnamon

I cannot start cinnamon-settings after upgrading to Linux Mint 17.2 / Cinnamon 2.6.8. This is the error I get when i try to start it from the command line:

 $ cinnamon-settings                    
Traceback (most recent call last):
  File "/usr/lib/cinnamon-settings/cinnamon-settings.py", line 12, in <module>
    from gi.repository import Gio, Gtk, GObject, GdkPixbuf, GLib, Pango, Gdk, cairo
ImportError: No module named gi.repository
 $ python --version
Python 2.7.6

I have tried reinstalling python-gi, python3-gi, python2.7-gi, python-gobject, gir1.2-gtk-3.0 with no luck.

Most helpful comment

While I have this issue several months ago, and here it comes again, due to the latest updates (04/07/2016). The problem is I cannot open any setting windows.
I got the error like:

$ cinnamon-settings
Traceback (most recent call last):
  File "/usr/share/cinnamon/cinnamon-settings/cinnamon-settings.py", line 12, in <module>
    import gi
ImportError: No module named gi

That's because I have my own python version (Anaconda) and the python this file included is

#!/usr/bin/env python2

which will use my customized one.
I tried to install a gi from pip, but still not work.

So simply, I just change the python version into the system one.

#!/usr/bin/python2

p.s. I am pretty sure I had this same issue twice, basically, it's because I have updated the cinnamon. The wired thing is I checked other python source file, which use system python to interpret, while have the _cinnamon-setting.py_ use the one from environment.

All 10 comments

what are the results of: which python?

then ls -la /usr/bin/python*

Is there anything in /usr/local/bin (specifically anything named python)?

 $ which python
/home/b***/bin/python
 $ ls -la /usr/bin/python
lrwxrwxrwx 1 root root 9 Dec 21  2013 /usr/bin/python -> python2.7
 $ /home/b***/bin/python --version
Python 2.7.6
 $ ls -al /home/b***/bin/python   
-rwxr-xr-x 1 b*** b*** 3349512 Apr 21 10:26 /home/b***/bin/python

Oh, and nothing in /usr/local/bin named python

Not sure why it's using something in your home folder - try renaming /home/b*/bin/python - you need to get the system to use the one in /usr/bin

This ended up working:

$ mv ~/bin/python ~/bin/old_python

Closing the Issue ... thanks for your help @mtwebster !

This is a legit issue on Arch installs where the default python version isn't that in the /usr/bin/python.
For instance, if the #!/usr/bin/env python2 is updated to point to the which python path, all of the settings light up again.

Logging this with the Arch crowd to make sure they can cross reference solution.

While I have this issue several months ago, and here it comes again, due to the latest updates (04/07/2016). The problem is I cannot open any setting windows.
I got the error like:

$ cinnamon-settings
Traceback (most recent call last):
  File "/usr/share/cinnamon/cinnamon-settings/cinnamon-settings.py", line 12, in <module>
    import gi
ImportError: No module named gi

That's because I have my own python version (Anaconda) and the python this file included is

#!/usr/bin/env python2

which will use my customized one.
I tried to install a gi from pip, but still not work.

So simply, I just change the python version into the system one.

#!/usr/bin/python2

p.s. I am pretty sure I had this same issue twice, basically, it's because I have updated the cinnamon. The wired thing is I checked other python source file, which use system python to interpret, while have the _cinnamon-setting.py_ use the one from environment.

@jinhw1989 Same thing happened to me after I updated Python. The solution works even though I didn't understand what happened.

@abdhan I am just guessing it was not consistent with your python environment. Well for the Cinnamon developers, they should pay attention to this issue.

In my case I had to switch

#!/usr/bin/env python2

To

#!/usr/bin/python

As far as I could understand, after installing a new version of python or updating something, python2 was pointing to some local/not global python version and python was pointing to the correct one, please check it too if you are having troubles.

Was this page helpful?
0 / 5 - 0 ratings