“ImportError: No module named glib” when running ScreenFetch












5














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
screenfetch









share|improve this question






















  • Edit your question and add the output of python -c 'import sys; print sys.path'
    – A.B.
    Dec 12 '15 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 '15 at 12:01


















5














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
screenfetch









share|improve this question






















  • Edit your question and add the output of python -c 'import sys; print sys.path'
    – A.B.
    Dec 12 '15 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 '15 at 12:01
















5












5








5


1





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
screenfetch









share|improve this question













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
screenfetch






command-line glib






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Dec 12 '15 at 11:38









reelyard

2619




2619












  • Edit your question and add the output of python -c 'import sys; print sys.path'
    – A.B.
    Dec 12 '15 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 '15 at 12:01




















  • Edit your question and add the output of python -c 'import sys; print sys.path'
    – A.B.
    Dec 12 '15 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 '15 at 12:01


















Edit your question and add the output of python -c 'import sys; print sys.path'
– A.B.
Dec 12 '15 at 11:57




Edit your question and add the output of python -c 'import sys; print sys.path'
– A.B.
Dec 12 '15 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 '15 at 12:01






@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 '15 at 12:01












3 Answers
3






active

oldest

votes


















2














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





share|improve this answer





















  • 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 '15 at 12:00



















2














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





share|improve this answer





























    0














    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.






    share|improve this answer





















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











    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "89"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f708777%2fimporterror-no-module-named-glib-when-running-screenfetch%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    3 Answers
    3






    active

    oldest

    votes








    3 Answers
    3






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    2














    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





    share|improve this answer





















    • 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 '15 at 12:00
















    2














    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





    share|improve this answer





















    • 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 '15 at 12:00














    2












    2








    2






    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





    share|improve this answer












    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






    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered Dec 12 '15 at 11:47









    A.B.

    67.9k12164254




    67.9k12164254












    • 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 '15 at 12:00


















    • 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 '15 at 12:00
















    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 '15 at 12:00




    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 '15 at 12:00













    2














    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





    share|improve this answer


























      2














      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





      share|improve this answer
























        2












        2








        2






        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





        share|improve this answer












        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






        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Jan 29 '16 at 19:22









        Tim

        213




        213























            0














            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.






            share|improve this answer





















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
















            0














            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.






            share|improve this answer





















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














            0












            0








            0






            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.






            share|improve this answer












            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.







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Dec 12 '15 at 11:41









            Hayden

            166




            166












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


















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
















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




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


















            draft saved

            draft discarded




















































            Thanks for contributing an answer to Ask Ubuntu!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.





            Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


            Please pay close attention to the following guidance:


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f708777%2fimporterror-no-module-named-glib-when-running-screenfetch%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Quarter-circle Tiles

            build a pushdown automaton that recognizes the reverse language of a given pushdown automaton?

            Mont Emei