Skip to content

Instantly share code, notes, and snippets.

@heaversm
Last active February 26, 2020 18:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save heaversm/af52abdd9f0bc8d3d3937894edf5dc52 to your computer and use it in GitHub Desktop.
Save heaversm/af52abdd9f0bc8d3d3937894edf5dc52 to your computer and use it in GitHub Desktop.
Frequently used python commands
#pyenv
#have pyenv manage versions:
echo 'eval "$(pyenv init -)"' >> ~/.bash_profile
#activate changes:
source ~/.bash_profile
#install particular versions
pyenv install X.X.X
#list installed pyenv versions
pyenv versions
#set a local (current directory) python version
pyenv local 3.x.x
#or set a global version
pyenv global 3.x.x
#list current python version
python -V
#set python3 as default:
#first, list python versions...
ls -l /usr/local/bin/python*
#then choose one and create an alias
ln -s -f /usr/local/bin/python3.7 /usr/local/bin/python
#then restart terminal
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment