Install pip for Python 2 with
sudo apt-get install python-pip
or for Python 3
sudo apt-get install python3-pip
Optional: Turn on bash autocomplete for pip
Run
pip completion --bash >> ~/.bashrc
and run source ~/.bashrc
to enable.
Install virtualenv with
sudo apt-get install virtualenv
The reason we are also installing virtualenvwrapper is because it offers nice and simple commands to manage your virtual environments. Because we want to avoid sudo pip
we install virtualenvwrapper
locally (by default under ~/.local
):
pip install --user virtualenvwrapper
or for Python 3
pip3 install --user virtualenvwrapper
and
echo "export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python3" >> ~/.bashrc