Skip to content

Instantly share code, notes, and snippets.

@heyajulia
Last active June 30, 2024 10:32
Show Gist options
  • Save heyajulia/254fa32f78d1005e050f25c722798dd5 to your computer and use it in GitHub Desktop.
Save heyajulia/254fa32f78d1005e050f25c722798dd5 to your computer and use it in GitHub Desktop.
How to Update Python using Pyenv

Here's what I do:

Stable versions

OLD_VERSION=$(cat ~/.pyenv/version)
NEW_VERSION=...
brew upgrade pyenv
pyenv install $NEW_VERSION
pyenv uninstall $OLD_VERSION
pyenv global $NEW_VERSION
pyenv rehash # idk if this is needed
pip install pipx
echo "poetry ipython" | xargs -n 1 pipx reinstall

Beta versions

brew upgrade pyenv
OLD_VERSION=...
NEW_VERSION=... # choose from pyenv install --list
pyenv install $NEW_VERSION
pyenv uninstall $OLD_VERSION
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment