Page 1 of 6 123 ... LastLast
Results 1 to 10 of 55

Thread: Unable to run pip/pip3 without root access

  1. #1

    Question Unable to run pip/pip3 without root access

    Hi,

    In a github issue about a python program I was told that running 'sudo pip install' is wrong with a link for more info:

    https://stackoverflow.com/questions/...-not-permitted

    Still for some reason without being root I am unable to run pip or pip3.

    Code:
    [~]: pip list
    Traceback (most recent call last):
      File "/usr/bin/pip", line 7, in <module>
        from pip import main
    ImportError: cannot import name 'main'
    [~]: pip3 list
    Traceback (most recent call last):
      File "/usr/bin/pip3", line 7, in <module>
        from pip import main
    ImportError: cannot import name 'main'
    What is the reason (and hopefully the fix) for this?

  2. #2
    Join Date
    Jun 2008
    Location
    Podunk
    Posts
    23,606
    Blog Entries
    15

    Default Re: Unable to run pip/pip3 without root access

    Quote Originally Posted by heyjoe View Post
    Hi,

    In a github issue about a python program I was told that running 'sudo pip install' is wrong with a link for more info:

    https://stackoverflow.com/questions/...-not-permitted

    Still for some reason without being root I am unable to run pip or pip3.

    Code:
    [~]: pip list
    Traceback (most recent call last):
      File "/usr/bin/pip", line 7, in <module>
        from pip import main
    ImportError: cannot import name 'main'
    [~]: pip3 list
    Traceback (most recent call last):
      File "/usr/bin/pip3", line 7, in <module>
        from pip import main
    ImportError: cannot import name 'main'
    What is the reason (and hopefully the fix) for this?
    Hi
    What program, link please... is there already a python package available?

    What shell are you using?

    FWIW, pip list works fine here as my user. Not sure how a MacOS thread is relevant?
    Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
    openSUSE Leap 42.3 (x86_64) GNOME 3.20.2
    If you find this post helpful and are logged into the web interface,
    please show your appreciation and click on the star below... Thanks!

  3. #3

    Default Re: Unable to run pip/pip3 without root access

    https://github.com/mps-youtube/mps-y...ment-358774035
    bash
    What has MacOS to do with Leap 42.3?

  4. #4
    Join Date
    Jun 2008
    Location
    Podunk
    Posts
    23,606
    Blog Entries
    15

    Default Re: Unable to run pip/pip3 without root access

    Quote Originally Posted by heyjoe View Post
    https://github.com/mps-youtube/mps-y...ment-358774035
    bash
    What has MacOS to do with Leap 42.3?
    Hi
    Exactly, the link you provided is related to MacOS issue with pip....

    Not sure because the developers linux instructions say to use sudo to install?
    Code:
    Installation
    Linux
    
    Using pip:
    
    [sudo] pip3 install mps-youtube
    Code:
     su -
    Password: 
    grover:~ # pip3 install mps-youtube
    Collecting mps-youtube
      Downloading mps_youtube-0.2.7.1-py3-none-any.whl (74kB)
        100% |████████████████████████████████| 77kB 1.7MB/s 
    Collecting pafy!=0.4.0,!=0.4.1,!=0.4.2,>=0.3.82 (from mps-youtube)
      Downloading pafy-0.5.3.1.tar.gz
    Installing collected packages: pafy, mps-youtube
      Running setup.py install for pafy
    Successfully installed mps-youtube-0.2.7.1 pafy-0.5.3.1
    pip3 install youtube-dl
    Collecting youtube-dl
      Downloading youtube_dl-2018.1.18-py2.py3-none-any.whl (1.7MB)
        100% |████████████████████████████████| 1.7MB 153kB/s 
    Installing collected packages: youtube-dl
    Successfully installed youtube-dl-2018.1.18
    Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
    openSUSE Leap 42.3 (x86_64) GNOME 3.20.2
    If you find this post helpful and are logged into the web interface,
    please show your appreciation and click on the star below... Thanks!

  5. #5

    Default Re: Unable to run pip/pip3 without root access

    Quote Originally Posted by malcolmlewis View Post
    Hi
    Exactly, the link you provided is related to MacOS issue with pip....
    I didn't notice that. Thanks for sharing your observation. I have added a comment to the github issue about it.
    I find it strange that you did exactly the same as I did and the program works for you... Are you running Leap 42.3? Are you starting the program as normal user (not root)?

  6. #6
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    22,394

    Default Re: Unable to run pip/pip3 without root access

    Quote Originally Posted by heyjoe View Post
    Are you starting the program as normal user (not root)?
    His copy/paste starts with:
    Code:
    su -
    Password: 
    grover:~ # pip3 install mps-youtube
    Isn't it clear that he switches to user root? And that the the prompt then shows a root prompt?

    And you have some story telling about that you do the same, but that something different happens. Please show that, like malcolmlewis shows it.
    Last edited by hcvv; 20-Jan-2018 at 02:43.
    Henk van Velden

  7. #7

    Default Re: Unable to run pip/pip3 without root access

    Quote Originally Posted by hcvv View Post
    Isn't it clear that he switches to user root? And that the the prompt then shows a root prompt?
    Perhaps you misunderstood my question. I was asking if he started the program 'mpsyt' as user or root (not the program 'pip3'). That is not obvious from the screenshot he shared.

    And you have some story telling about that you do the same, but that something different happens. Please show that, like malcolmlewis shows it.
    It's in the linked bug report with full details.

  8. #8
    Join Date
    Jun 2008
    Location
    Podunk
    Posts
    23,606
    Blog Entries
    15

    Default Re: Unable to run pip/pip3 without root access

    Quote Originally Posted by heyjoe View Post
    I didn't notice that. Thanks for sharing your observation. I have added a comment to the github issue about it.
    I find it strange that you did exactly the same as I did and the program works for you... Are you running Leap 42.3? Are you starting the program as normal user (not root)?
    Hi
    Yes, this system is Leap 42.3, plus in this case it's in my signature

    Installed as root (never use sudo except added with visudo for /usr/bin/build for osc command and building packages), and yes, running the application as my user.
    Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
    openSUSE Leap 42.3 (x86_64) GNOME 3.20.2
    If you find this post helpful and are logged into the web interface,
    please show your appreciation and click on the star below... Thanks!

  9. #9

    Default Re: Unable to run pip/pip3 without root access

    Quote Originally Posted by malcolmlewis View Post
    and yes, running the application as my user.
    Weird. Might that have anything to do with any security policies (or I don't know what)? Otherwise I can't explain why the same software on the same OS doesn't work the same way.

  10. #10
    Join Date
    Jun 2008
    Location
    Podunk
    Posts
    23,606
    Blog Entries
    15

    Default Re: Unable to run pip/pip3 without root access

    Quote Originally Posted by heyjoe View Post
    Weird. Might that have anything to do with any security policies (or I don't know what)? Otherwise I can't explain why the same software on the same OS doesn't work the same way.
    Hi
    If you create a test user does it run as that user without error?

    Else it is probably some conflict on what you may have previously installed, adjusted your user path at all?
    Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
    openSUSE Leap 42.3 (x86_64) GNOME 3.20.2
    If you find this post helpful and are logged into the web interface,
    please show your appreciation and click on the star below... Thanks!

Page 1 of 6 123 ... LastLast

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •