Install virtualenv on ubuntu 18.04
May 9, 2018Notes howto install virtualenvwrapper on Ubuntu 18.04 with prezto (zsh)
And this is “a works for me” documentation, and perhaps not for you :) If you have any suggestions or questions pls ask in the comments.
Lets start
Begin with an update of the repos.
sudo apt update; sudo apt -y dist-upgrade; sudo apt -y autoremove
Install pip for python 3
sudo apt install python3-pip
Install virtualenv and virtualenvwrapper with pip as $USER
pip3 install virtualenv virtualenvwrapper
Make a backup of your existing .zshrc
cp ~/.zshrc ~/.zshrc_backup
Push virtualenvwrapper.sh in to .zshrc
echo -en '\n\n#virtualenvwrapper\nexport VIRTUALENVWRAPPER_PYTHON=/usr/bin/python3\nexport WORKON_HOME=~/virtualenvs\nsource ~/.local/bin/virtualenvwrapper.sh\n' >> ~/.zshrc
Create virtualenvwrapper home
mkdir -p $WORKON_HOME
If you don’t already have ~/.local/bin in your path.
Edit ~./zprofile and add ~/.local/bin to the path
path=(
/usr/local/{bin,sbin}
~/.local/bin
$path
)
Reload settings in .zshrc and .zprofile
source ~/.zshrc
source ~/.zprofile
Done
And at last do not forget your well earned Coffee.