pyenv for Simple Python Version Management
Published on .
Python has an incredible ecosystem, but version management can be a chore even for things as simple as having to run python3
from the command line. pyenv
(https://github.com/pyenv/pyenv) is a simple solution which can be as simple as:
brew install pyenv
- Now modify your
~/.zshrc
(or whatever) with:export PYENV_ROOT="$HOME/.pyenv"
export PATH="$PYENV_ROOT/bin:$PATH"
pyenv install 3.11
(or whatever version you want)- And if you’re me
pyenv global 3.11
That’s it. No more python3
non-sense.
What I really like about pynev
is that it’s just shell scripts, so it is easy to get rid of, if needed.