Skip to content

Instantly share code, notes, and snippets.

@karlding
Last active June 2, 2020 03:45
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save karlding/18e47708942dd3c0ca1c4b3c6eac9dd9 to your computer and use it in GitHub Desktop.
Save karlding/18e47708942dd3c0ca1c4b3c6eac9dd9 to your computer and use it in GitHub Desktop.
pyenv and virtualenv cheat sheet

pyenv + virtualenvwrapper cheat sheet

Requirements

Usage

Install new Python versions

pyenv install 2.7.13

Anytime we install a new Python version, we immediately install virtualenvwrapper

# switch versions
pyenv shell 2.7.13

# install virtualenvwrapper_lazy
pyenv virtualenvwrapper_lazy

Then to actually use the virtualenv

# create a new virtualenv
mkvirtualenv my_environment

# disable virtualenv
deactivate

# list all environments
workon

# reactivate virtualenv
workon my_environment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment