Skip to content

Instantly share code, notes, and snippets.

@jstoiko
Created June 12, 2015 20:02
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jstoiko/5492f8baa69c1722b984 to your computer and use it in GitHub Desktop.
Save jstoiko/5492f8baa69c1722b984 to your computer and use it in GitHub Desktop.
Using tox, pyenv and multiple version of python on OSX

Install pyenv using homebrew:

$ brew install pyenv

Install multiple versions of python:

$ pyenv install 3.2.6 3.3.6 3.4.3

In your ~/.profile, add:

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

# PATH for python
PATH=/usr/local/share/python:${PATH}
# for homebrewed bottles
PATH=/usr/local/bin:/usr/local/sbin:${PATH}
# for custom scripts
PATH=$HOME/bin:${PATH}
# for pyenv
PYENV_ROOT=$HOME/.pyenv
PATH=$PYENV_ROOT/bin:${PATH}

export PATH

In virtualenv directory:

$ pyenv local 3.2.6 3.3.6 3.4.3
@andreif
Copy link

andreif commented Feb 23, 2017

Thanks, very helpful. I do pyenv local my_env_with_tox 2.7.12 3.4.2 3.5.2 3.6.0 so that the original versions are kept clean

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