Menu

VanDragt.com

Thought on privacy, tech and media.

How to install pip and pipenv properly on Ubuntu 17.10

Ubuntu 17.10 comes with python3 3.6.3 installed by default but not pip and pipenv. We can install install pip systemwide and pipenv into the user local bin so we can use all the convenience when working with our python projects:

wget https://bootstrap.pypa.io/get-pip.py -O /tmp/get-pip.py
sudo python3 /tmp/get-pip.py
pip install --user pipenv
echo "PATH=$HOME/.local/bin:$PATH" >> ~/.profile
source ~/.profile

Sources: Installing Python 3 on Linux; pip installation; Installing pipenv; How to permanently set PATH on Linux

Update 9 Nov 2017: replaced curl with wget, thanks Peter

Comments

Peter says:

Just a side note: If you don’t dare to install `curl` simply use `wget`, which is installed on Ubuntu 17.10 Artful by default:

“`
# Note the capital “-O” option
wget https://bootstrap.pypa.io/get-pip.py -O /tmp/get-pip.py
“`

Note that you need to re-login after the changes to `~/.profile`. Sourcing the file is optional. https://help.ubuntu.com/community/EnvironmentVariables#Session-wide_environment_variables

_Thanks for this boiled-down installation summary!_

Sander says:

Thanks Peter for your comment, I’ve updated the post with your wget recommendation to simplify things further!

Sourcing ~/.profile ensures that pipenv can be executed from the current shell rather than having to start a new one.

Leave a Reply