Python imports working for root, but not specific user











up vote
0
down vote

favorite












I'm trying to run a python script through a user account, call it myuser. I want to be able to execute the dropbox.py script without logging into or su'ing into root. The program works perfectly when I am either logged in as root, or su'd into root, but I want to find a way to not have to su over to root and then run it every time I start up.



When I run it as myuser, I get the following error:



[myuser@localhost Utilities]$ python dropbox.py start
Starting Dropbox...
The Dropbox daemon is not installed!
Run "dropbox start -i" to install the daemon


So, I run it with the -i option, as recommended and get the following:



[myuser@localhost Utilities]$ python dropbox.py start -i
Starting Dropbox...Traceback (most recent call last):
File "dropbox.py", line 1404, in start
download()
File "dropbox.py", line 280, in download
import pygtk
ImportError: No module named pygtk


I ran it with strace and I get line after line that looks roughly like this:



open("/home/myuser/Downloads/pygtk.so", O_RDONLY) = -1 ENOENT (No such file or directory)


There are no differences in the .bashrc, .bash_profiles, .bash_history files of either profile. I also checked the .config folder for differences and found none.



Again, the weirdest thing is that it works fine as root, but it doesn't work when logged in as myuser. root is having no problem at all importing in the elusive pygtk package.



Is there some kind of python permission(s) or configuration I need to set somewhere to allow other users to import packages? Is there a configuration setting of some kind I am missing in the myuser account?



Thanks!










share|improve this question














bumped to the homepage by Community 2 days ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.















  • Use your distribution's binary packages for preference. Or if you don't have the necessary permissions, ask someone with those permissions to install the necessary packages.
    – Faheem Mitha
    Dec 25 '15 at 15:25















up vote
0
down vote

favorite












I'm trying to run a python script through a user account, call it myuser. I want to be able to execute the dropbox.py script without logging into or su'ing into root. The program works perfectly when I am either logged in as root, or su'd into root, but I want to find a way to not have to su over to root and then run it every time I start up.



When I run it as myuser, I get the following error:



[myuser@localhost Utilities]$ python dropbox.py start
Starting Dropbox...
The Dropbox daemon is not installed!
Run "dropbox start -i" to install the daemon


So, I run it with the -i option, as recommended and get the following:



[myuser@localhost Utilities]$ python dropbox.py start -i
Starting Dropbox...Traceback (most recent call last):
File "dropbox.py", line 1404, in start
download()
File "dropbox.py", line 280, in download
import pygtk
ImportError: No module named pygtk


I ran it with strace and I get line after line that looks roughly like this:



open("/home/myuser/Downloads/pygtk.so", O_RDONLY) = -1 ENOENT (No such file or directory)


There are no differences in the .bashrc, .bash_profiles, .bash_history files of either profile. I also checked the .config folder for differences and found none.



Again, the weirdest thing is that it works fine as root, but it doesn't work when logged in as myuser. root is having no problem at all importing in the elusive pygtk package.



Is there some kind of python permission(s) or configuration I need to set somewhere to allow other users to import packages? Is there a configuration setting of some kind I am missing in the myuser account?



Thanks!










share|improve this question














bumped to the homepage by Community 2 days ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.















  • Use your distribution's binary packages for preference. Or if you don't have the necessary permissions, ask someone with those permissions to install the necessary packages.
    – Faheem Mitha
    Dec 25 '15 at 15:25













up vote
0
down vote

favorite









up vote
0
down vote

favorite











I'm trying to run a python script through a user account, call it myuser. I want to be able to execute the dropbox.py script without logging into or su'ing into root. The program works perfectly when I am either logged in as root, or su'd into root, but I want to find a way to not have to su over to root and then run it every time I start up.



When I run it as myuser, I get the following error:



[myuser@localhost Utilities]$ python dropbox.py start
Starting Dropbox...
The Dropbox daemon is not installed!
Run "dropbox start -i" to install the daemon


So, I run it with the -i option, as recommended and get the following:



[myuser@localhost Utilities]$ python dropbox.py start -i
Starting Dropbox...Traceback (most recent call last):
File "dropbox.py", line 1404, in start
download()
File "dropbox.py", line 280, in download
import pygtk
ImportError: No module named pygtk


I ran it with strace and I get line after line that looks roughly like this:



open("/home/myuser/Downloads/pygtk.so", O_RDONLY) = -1 ENOENT (No such file or directory)


There are no differences in the .bashrc, .bash_profiles, .bash_history files of either profile. I also checked the .config folder for differences and found none.



Again, the weirdest thing is that it works fine as root, but it doesn't work when logged in as myuser. root is having no problem at all importing in the elusive pygtk package.



Is there some kind of python permission(s) or configuration I need to set somewhere to allow other users to import packages? Is there a configuration setting of some kind I am missing in the myuser account?



Thanks!










share|improve this question













I'm trying to run a python script through a user account, call it myuser. I want to be able to execute the dropbox.py script without logging into or su'ing into root. The program works perfectly when I am either logged in as root, or su'd into root, but I want to find a way to not have to su over to root and then run it every time I start up.



When I run it as myuser, I get the following error:



[myuser@localhost Utilities]$ python dropbox.py start
Starting Dropbox...
The Dropbox daemon is not installed!
Run "dropbox start -i" to install the daemon


So, I run it with the -i option, as recommended and get the following:



[myuser@localhost Utilities]$ python dropbox.py start -i
Starting Dropbox...Traceback (most recent call last):
File "dropbox.py", line 1404, in start
download()
File "dropbox.py", line 280, in download
import pygtk
ImportError: No module named pygtk


I ran it with strace and I get line after line that looks roughly like this:



open("/home/myuser/Downloads/pygtk.so", O_RDONLY) = -1 ENOENT (No such file or directory)


There are no differences in the .bashrc, .bash_profiles, .bash_history files of either profile. I also checked the .config folder for differences and found none.



Again, the weirdest thing is that it works fine as root, but it doesn't work when logged in as myuser. root is having no problem at all importing in the elusive pygtk package.



Is there some kind of python permission(s) or configuration I need to set somewhere to allow other users to import packages? Is there a configuration setting of some kind I am missing in the myuser account?



Thanks!







fedora root dropbox






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Dec 25 '15 at 5:41









ljhennessy

13




13





bumped to the homepage by Community 2 days ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.







bumped to the homepage by Community 2 days ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.














  • Use your distribution's binary packages for preference. Or if you don't have the necessary permissions, ask someone with those permissions to install the necessary packages.
    – Faheem Mitha
    Dec 25 '15 at 15:25


















  • Use your distribution's binary packages for preference. Or if you don't have the necessary permissions, ask someone with those permissions to install the necessary packages.
    – Faheem Mitha
    Dec 25 '15 at 15:25
















Use your distribution's binary packages for preference. Or if you don't have the necessary permissions, ask someone with those permissions to install the necessary packages.
– Faheem Mitha
Dec 25 '15 at 15:25




Use your distribution's binary packages for preference. Or if you don't have the necessary permissions, ask someone with those permissions to install the necessary packages.
– Faheem Mitha
Dec 25 '15 at 15:25










3 Answers
3






active

oldest

votes

















up vote
1
down vote













$ sudo dnf install pygtk2.x86_64


Worked for me.






share|improve this answer




























    up vote
    0
    down vote













    there seems many possibilities. first , you can try by making the "myuser" as member of some administrative group such as wheel group or you can give it the required rights in sudoers file.
    the second way i that i think is more suitable to first install the required python package that provides the pygtk module , it should be something like this:



         #sudo apt-get install python-gtk2-dev


    and then run the program again , there should be no module error this time.



    or if you are sure that the package is already installed then you should check the python path and make sure it is available with proper permissions to myuser. The function import looks for files into your PYTHONPATH env. variable and your local directory.






    share|improve this answer






























      up vote
      0
      down vote













      Probably a permission problem somewhere. Check that the package is correctly installed, by e.g.



      yum reinstall 《offending file》



      should refresh/fix the installation.



      Other possibilities are that the en environment variables for Python aren't set up correctly, or that your user has some locally (for the account only) packages installed, and those are stale (old, no longer working) or plain broken.
      enter code here






      share|improve this answer





















        Your Answer








        StackExchange.ready(function() {
        var channelOptions = {
        tags: "".split(" "),
        id: "106"
        };
        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',
        convertImagesToLinks: false,
        noModals: true,
        showLowRepImageUploadWarning: true,
        reputationToPostImages: null,
        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%2funix.stackexchange.com%2fquestions%2f251455%2fpython-imports-working-for-root-but-not-specific-user%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








        up vote
        1
        down vote













        $ sudo dnf install pygtk2.x86_64


        Worked for me.






        share|improve this answer

























          up vote
          1
          down vote













          $ sudo dnf install pygtk2.x86_64


          Worked for me.






          share|improve this answer























            up vote
            1
            down vote










            up vote
            1
            down vote









            $ sudo dnf install pygtk2.x86_64


            Worked for me.






            share|improve this answer












            $ sudo dnf install pygtk2.x86_64


            Worked for me.







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Apr 18 '17 at 19:14









            Diogo PEREIRA MARQUES

            111




            111
























                up vote
                0
                down vote













                there seems many possibilities. first , you can try by making the "myuser" as member of some administrative group such as wheel group or you can give it the required rights in sudoers file.
                the second way i that i think is more suitable to first install the required python package that provides the pygtk module , it should be something like this:



                     #sudo apt-get install python-gtk2-dev


                and then run the program again , there should be no module error this time.



                or if you are sure that the package is already installed then you should check the python path and make sure it is available with proper permissions to myuser. The function import looks for files into your PYTHONPATH env. variable and your local directory.






                share|improve this answer



























                  up vote
                  0
                  down vote













                  there seems many possibilities. first , you can try by making the "myuser" as member of some administrative group such as wheel group or you can give it the required rights in sudoers file.
                  the second way i that i think is more suitable to first install the required python package that provides the pygtk module , it should be something like this:



                       #sudo apt-get install python-gtk2-dev


                  and then run the program again , there should be no module error this time.



                  or if you are sure that the package is already installed then you should check the python path and make sure it is available with proper permissions to myuser. The function import looks for files into your PYTHONPATH env. variable and your local directory.






                  share|improve this answer

























                    up vote
                    0
                    down vote










                    up vote
                    0
                    down vote









                    there seems many possibilities. first , you can try by making the "myuser" as member of some administrative group such as wheel group or you can give it the required rights in sudoers file.
                    the second way i that i think is more suitable to first install the required python package that provides the pygtk module , it should be something like this:



                         #sudo apt-get install python-gtk2-dev


                    and then run the program again , there should be no module error this time.



                    or if you are sure that the package is already installed then you should check the python path and make sure it is available with proper permissions to myuser. The function import looks for files into your PYTHONPATH env. variable and your local directory.






                    share|improve this answer














                    there seems many possibilities. first , you can try by making the "myuser" as member of some administrative group such as wheel group or you can give it the required rights in sudoers file.
                    the second way i that i think is more suitable to first install the required python package that provides the pygtk module , it should be something like this:



                         #sudo apt-get install python-gtk2-dev


                    and then run the program again , there should be no module error this time.



                    or if you are sure that the package is already installed then you should check the python path and make sure it is available with proper permissions to myuser. The function import looks for files into your PYTHONPATH env. variable and your local directory.







                    share|improve this answer














                    share|improve this answer



                    share|improve this answer








                    edited Dec 25 '15 at 9:22

























                    answered Dec 25 '15 at 9:17









                    Ijaz Ahmad Khan

                    3,36431334




                    3,36431334






















                        up vote
                        0
                        down vote













                        Probably a permission problem somewhere. Check that the package is correctly installed, by e.g.



                        yum reinstall 《offending file》



                        should refresh/fix the installation.



                        Other possibilities are that the en environment variables for Python aren't set up correctly, or that your user has some locally (for the account only) packages installed, and those are stale (old, no longer working) or plain broken.
                        enter code here






                        share|improve this answer

























                          up vote
                          0
                          down vote













                          Probably a permission problem somewhere. Check that the package is correctly installed, by e.g.



                          yum reinstall 《offending file》



                          should refresh/fix the installation.



                          Other possibilities are that the en environment variables for Python aren't set up correctly, or that your user has some locally (for the account only) packages installed, and those are stale (old, no longer working) or plain broken.
                          enter code here






                          share|improve this answer























                            up vote
                            0
                            down vote










                            up vote
                            0
                            down vote









                            Probably a permission problem somewhere. Check that the package is correctly installed, by e.g.



                            yum reinstall 《offending file》



                            should refresh/fix the installation.



                            Other possibilities are that the en environment variables for Python aren't set up correctly, or that your user has some locally (for the account only) packages installed, and those are stale (old, no longer working) or plain broken.
                            enter code here






                            share|improve this answer












                            Probably a permission problem somewhere. Check that the package is correctly installed, by e.g.



                            yum reinstall 《offending file》



                            should refresh/fix the installation.



                            Other possibilities are that the en environment variables for Python aren't set up correctly, or that your user has some locally (for the account only) packages installed, and those are stale (old, no longer working) or plain broken.
                            enter code here







                            share|improve this answer












                            share|improve this answer



                            share|improve this answer










                            answered Dec 25 '15 at 14:09









                            vonbrand

                            14.1k22644




                            14.1k22644






























                                draft saved

                                draft discarded




















































                                Thanks for contributing an answer to Unix & Linux Stack Exchange!


                                • 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%2funix.stackexchange.com%2fquestions%2f251455%2fpython-imports-working-for-root-but-not-specific-user%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

                                Accessing regular linux commands in Huawei's Dopra Linux

                                Can't connect RFCOMM socket: Host is down

                                Kernel panic - not syncing: Fatal Exception in Interrupt