Skip to content

Instantly share code, notes, and snippets.

@gsrai
Created September 17, 2022 14:12
Show Gist options
  • Save gsrai/e29ff6c8eae1ae043b409fdd17d78b28 to your computer and use it in GitHub Desktop.
Save gsrai/e29ff6c8eae1ae043b409fdd17d78b28 to your computer and use it in GitHub Desktop.
python install on mac

Install Python on Mac

  1. brew install pyenv
  2. Add this to your ~/.zshrc:
export PYENV_ROOT="$HOME/.pyenv"
export PATH="$PYENV_ROOT/shims:$PATH"
if command -v pyenv 1>/dev/null 2>&1; then
  eval "$(pyenv init --path)"
  eval "$(pyenv init -)"
fi
  1. pyenv install 3.10.6
  2. pyenv global 3.10.6
  3. Verify with pyenv versions
  4. pip install virtualenv
  5. brew install pyenv-virtualenv
  6. Add this to your ~/.zshrc: eval "$(pyenv virtualenv-init -)"
  7. close and open terminal
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment