Skip to content

Instantly share code, notes, and snippets.

@nopedev
Last active April 19, 2018 04:48
Show Gist options
  • Save nopedev/7442f4b118b052d38a78cbb4197f8d62 to your computer and use it in GitHub Desktop.
Save nopedev/7442f4b118b052d38a78cbb4197f8d62 to your computer and use it in GitHub Desktop.

python

pyenv

install pyenv

brew update

brew install pyenv

add to .bash_profile

export PYENV_ROOT="$HOME/.pyenv"
export PATH="$PYENV_ROOT/bin:$PATH"
if command -v pyenv 1>/dev/null 2>&1; then
     eval "$(pyenv init -)"
fi

check installed versions

pyenv versions

check available verions

pyenv install -l

set global python version

pyenv global 3.6.5

pyenv-virtualenv

install pyenv-virtualenv

brew install pyenv-virtualenv

add to .bash_profile

eval "$(pyenv virtualenv-init -)"

create virtualenv

pyenv virtualenv 3.6.5 <env_name>

virtualenv list

pyenv virtualenvs

remove virtualenv

pyenv uninstall <env_name>

activate & deactivate

pyenv activate <env_name>

pyenv deactivate <env_name>

or use .python-version file

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