When opening terminal I get the follow 4 lines before ScreenFetch runs:

[[ ! ]] Traceback (most recent call last):
[[ ! ]]   File "/usr/bin/unity", line 21, in <module>
[[ ! ]]     import glib
[[ ! ]] ImportError: No module named glib

I assumed that all I need to do is install the 'glib' package, so I ran:

sudo apt-cache search glib

to try and find the package myself, but there's literally hundreds of results returned to me, and I'm not sure which one is the one I need. If I remove ScreenFetch from the bashrc then I don't get any errors. After the first 4 lines ScreenFetch runs fine and I can use terminal normally, it's just a little bit annoying that's all.

Any help would be very appreciated.

Edit: sorry, forgot to include the line in my bashrc file. Here it is:

# start screenfetch
  • Edit your question and add the output of python -c 'import sys; print sys.path'
    – A.B.
    Dec 12, 2015 at 11:57
  • @A.B. I'm confused, why do I need to change the question? And what does the link of code you've quoted mean/do?
    – reelyard
    Dec 12, 2015 at 12:01

3 Answers 3


You need to install the python gtk libraries to get access to python's "glib" module. In 15.10:

sudo apt-get install python-gtk2

The module is in the packages python-dbus, python3-dbus and in some other packages, see below. /usr/bin/unity depends on Python2. And for this reason:

sudo apt-get install --reinstall python-dbus

List of available glib.py

% apt-file search --regex /glib.py$                        
libglib2.0-0-dbg: /usr/share/glib-2.0/gdb/glib.py
python-dbus: /usr/lib/python2.7/dist-packages/dbus/glib.py
python-dbus: /usr/lib/python2.7/dist-packages/dbus/mainloop/glib.py
python-pyudev: /usr/lib/python2.7/dist-packages/pyudev/glib.py
python-ubuntu-kylin-sso-client: /usr/lib/python2.7/dist-packages/ubuntu-kylin-sso-client/ubuntu_kylin_sso/main/glib.py
python-ubuntu-kylin-sso-client: /usr/lib/python2.7/dist-packages/ubuntu-kylin-sso-client/ubuntu_kylin_sso/utils/runner/glib.py
python-ubuntu-sso-client: /usr/lib/python2.7/dist-packages/ubuntu-sso-client/ubuntu_sso/main/glib.py
python-ubuntu-sso-client: /usr/lib/python2.7/dist-packages/ubuntu-sso-client/ubuntu_sso/utils/runner/glib.py
python-ubuntuone-devtools: /usr/lib/python2.7/dist-packages/ubuntuone-dev-tools/ubuntuone/devtools/reactors/glib.py
python-xmmsclient: /usr/lib/python2.7/dist-packages/xmmsclient/glib.py
python3-dbus: /usr/lib/python3/dist-packages/dbus/glib.py
python3-dbus: /usr/lib/python3/dist-packages/dbus/mainloop/glib.py
python3-pyudev: /usr/lib/python3/dist-packages/pyudev/glib.py
  • I ran the first command which reinstalled python-dbus, but that didn't fix the issue. So then I did a sudo install on libglib2.0-0-dbg to see if that would help but again, it didn't fix the problem. I've decided to uninstall ScreenFetch and use Archey instead. Thanks for your help though.
    – reelyard
    Dec 12, 2015 at 12:00

This is defiantly a problem with Unity. When Unity was compiled it didn't build glib properly on your machine. I am not going to tell you to reinstall Unity. If the program still runs smoothly you shouldn't need to worry.

  • answering to Hayden: No, it's not a Unity only issue, arises also in Xfce (Xubuntu 18.04.1) Dec 11, 2018 at 11:36

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.