Python Pip Permissions

7,003

I would again purge python-pip and install it differently

 wget https://bootstrap.pypa.io/get-pip.py

Then

 sudo python get-pip.py 

And see if that works better for you.

edit

This route will get you newer than what in repo. You can also then update using

 pip install -U pip

Not sure if you can do that if installed with apt-get.

Share:
7,003

Related videos on Youtube

JREAM
Author by

JREAM

I enjoy programming a lot! I work in Linux, Node, Python, PHP, React, Vue, DevOps, SysAdmin, Docker, and a bundle of frameworks in between. I don't know everything, I have a lot of questions too -- sometimes so silly that I feel silly I asked! JREAM.com - SaaS, but it's changing. JREAM YouTube - Lots of video content to learn code. CodeZeus.com - WIP GitHub - Of Course! GitLab - My preferred

Updated on September 18, 2022

Comments

  • JREAM
    JREAM over 1 year

    I deleted Python on 14.04, woops! It was 4am and I can't remember why I was doing this. So I re-installed it and all and it works, except for some of that good old virtualenvwrapper.

    I've searched all over the internet to figure out what's wrong, I have the correct owners on ~/.cache/pip to jesse:jesse. Does anyone know how I can fix this?

    pip

    I only have one problem, when I use $ pip I get this error:

    The directory '/home/jesse/.cache/pip/http' or its parent directory is not owned 
    by the current user and the cache has been disabled. Please check the permissions 
    and owner of that directory. If executing pip with sudo, you may want the -H flag.
    

    .bashrc

    Then when I load a terminal or just run $ source ~/.bashrc

    /usr/local/bin/python2.7: No module named virtualenvwrapper
    virtualenvwrapper.sh: There was a problem running the initialization hooks. 
    
    If Python could not import the module virtualenvwrapper.hook_loader,
    check that virtualenvwrapper has been installed for
    VIRTUALENVWRAPPER_PYTHON=/usr/local/bin/python2.7 and that PATH is
    set properly.
    

    Using

    • 14.04 Desktop
    • pip 6.0.6
    • python 2.7.9

    Tried

    • Uninstall pip
    • Removing ~/.cache/pip
    • Reinstalling sudo apt-get python-pip
    • Reinstalling easy_install pip
    • Chown on ~/.cache/pip to jesse:jesse
    • Deleting/Removing Python packages a lot, lol.
  • geoffmcc
    geoffmcc about 9 years
    @JREAM Glad it worked for you!
  • geoffmcc
    geoffmcc about 9 years
    No problem. This gets you newer than what in repo. You can also update using pip install -U pip