Skip to content

Instantly share code, notes, and snippets.

@lee-pai-long
Last active May 10, 2017 14:17
Show Gist options
  • Save lee-pai-long/4a56f4e5d7b66a78d7cf347ac75dee04 to your computer and use it in GitHub Desktop.
Save lee-pai-long/4a56f4e5d7b66a78d7cf347ac75dee04 to your computer and use it in GitHub Desktop.

[PYTHON] Virtualenvwrapper for python 3

Install Virtualenvwrapper

$ [sudo -H] pip[3] install virtualenvwrapper

Create virtualenv home directory

$ mkdir ~/.virtualenvs

Setup work and project directory in ~/.bashrc

export WORKON_HOME=$HOME/.virtualenvs    
export PROJECT_HOME=$HOME/[PROJECT_FOLDER]
source /usr/local/bin/virtualenvwrapper.sh

Add mkvirtualenv aliases

alias mkvenv3='mkvirtualenv --python=/usr/bin/python3 '
alias mkvenv3.1='mkvirtualenv --python=/usr/bin/python3.1 '
alias mkvenv3.2='mkvirtualenv --python=/usr/bin/python3.2 '
alias mkvenv3.3='mkvirtualenv --python=/usr/bin/python3.3 '
alias mkvenv3.4='mkvirtualenv --python=/usr/bin/python3.4 '

Note : python3 should point to the latest python installed, here python3.5 that's why we add aliases for each previous python3 versions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment