Skip to content

Instantly share code, notes, and snippets.

@jcasadella
Last active October 28, 2018 07:11
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save jcasadella/2674cf99a2ea17fc7e9aa16f49b9e7d5 to your computer and use it in GitHub Desktop.
Save jcasadella/2674cf99a2ea17fc7e9aa16f49b9e7d5 to your computer and use it in GitHub Desktop.

Documentation Python

Credit to Christian Perez (https://github.com/chris-zen)

Install dependencies

brew install pyenv

Install different Python versions without conflicts

pyenv install 2.7.12
pyenv global 2.7.12

Install pyenv-virtualenvwrapper

https://github.com/pyenv/pyenv-virtualenvwrapper

brew install pyenv-virtualenvwrapper

Add theses lines into .bashrc or .zshrc:

# Pyenv
if which pyenv > /dev/null; then eval "$(pyenv init -)"; fi
if which pyenv-virtualenv-init > /dev/null; then eval "$(pyenv virtualenv-init -)"; fi
pyenv virtualenvwrapper_lazy

Create new environment

mkvirtualenv test_env

List environments

workon

Select a virutal environment

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