I want to get the most recent version (8.1.2) of pip. I'm using Ubuntu 14.04 and python 2.7.6. The version of pip in the Ubuntu repositories is only 1.5.4 (and can't install things like numpy). How are you actually meant to upgrade pip? I've discovered a few ways; maybe they're all equivalent but it would be good to know for sure.
Option 1: Upgrade pip with pip and change the link
apt-get install python-pip
pip install --upgrade pip
pip --version # still shows 1.5.4
ln -s /usr/local/bin/pip /usr/bin/
pip --version # 8.1.2, success!
Option 1a: Like above, but use python -m pip
pip install --upgrade pip
pip --version # still shows 1.5.4
python -m pip --version # 8.1.2, success!
Option 2: easy_install
easy_install -U pip
pip --version # 8.1.2, success!
Option 3: Use a virtualenv (I know virtualenvs are awesome but I'm doing the installing in a docker container, so I was just going to install things globally).
virtualenv test123
source test123/bin/activate
pip --version # pip 8.1.2 from ~/test123/local/lib/python2.7/site-packages
Option 4: The pip website suggests using their get-pip.py script, but also says this might leave the Ubuntu package manager in an inconsistent state.
Option 5: Upgrade Python: "pip is already installed if you're using Python 2 >=2.7.9", but this seems like overkill.
Is one of these the preferred method? Is there a better way I haven't found? Am I overthinking this?
Updating Pip b is available.” You can run “pip install --upgrade pip” to install and use the new version of pip. To update pip2 or pip3 using this command, only replace the first pip with the pip version.
Whether you're setting up a development environment or writing your Dockerfile , make sure you upgrade pip . Otherwise you'll have a much harder time installing packages.
Use pip install notebook --upgrade or conda upgrade notebook to upgrade to the latest release. We strongly recommend that you upgrade to version 9+ of pip before upgrading notebook . Use pip install pip --upgrade to upgrade pip.
The most painless way that I found that works is to use install virtualenv
and use pip
inside a virtualenv. This does not even require you install pip
at the system level (which you might have done by running sudo apt-get install python-pip
):
sudo apt-get install python-virtualenv # install virtualenv
virtualenv venv # create a virtualenv named venv
source venv/bin/activate # activate virtualenv
pip install -U pip # upgrade pip inside virtualenv
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With