I screwed up the system version of Python Pip on Ubuntu 12.10

前端 未结 6 883
被撕碎了的回忆
被撕碎了的回忆 2020-12-07 10:08

I wanted to update pip on my main install of Python, specifically to get the list command. Which also includes the list- updates capability.

So I ran:



        
6条回答
  •  失恋的感觉
    2020-12-07 10:36

    Before getting happy with apt-get removes and installs. It's worthwhle to reset your bash cache.

    hash -r
    

    Bash will cache the path to pip using the distrubtion install (apt-get) which is /usr/bin/pip. If you're still in the same shell session, due to the cache, after updating pip from pip your shell will still look in /usr/bin/ and not /usr/local/bin/

    for example:

    $apt-get install python-pip
    $which pip
    /usr/bin/pip
    
    $pip install -U pip
    $which pip
    /usr/bin/pip
    
    $hash -r
    $which pip
    /usr/local/bin/pip
    

提交回复
热议问题