Skip to content

Instantly share code, notes, and snippets.

@msyvr
Created September 10, 2021 02:25
Show Gist options
  • Save msyvr/a5a9473f2def4e53ea8b0471046b9bdf to your computer and use it in GitHub Desktop.
Save msyvr/a5a9473f2def4e53ea8b0471046b9bdf to your computer and use it in GitHub Desktop.
resource: https://opensource.com/article/19/5/python-3-default-mac
---
essentials:
1. Install pyenv:
$ brew install pyenv
2. Install desired version of python:
$ pyenv install 3.9.0
3. Set global default version
$ pyenv global 3.9.0
4. Verify it worked
$ pyenv version
5. Give pyenv control over shell path (is z shell not bash, the filename at the end would be ~./zshrc):
$ echo -e 'if command -v pyenv 1>/dev/null 2>&1; then\n eval "$(pyenv init -)"\nfi' >> ~/.bash_profile
---
from resource above: "Now we know for certain that we're using Python 3.7.3 and pip will update alongside it without any manual aliasing between versions. Using Moshe's recommendation to use a version manager (pyenv) enables us to easily accept future upgrades without getting confused about which Python we are running at a given time."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment