Via the Advent of Code 2021 I've been doing more with Python on macOS, and was struggling with versions, given that Apple kindly include Python 2 embedded in the OS, whereas I needed Python 3.10.0 for the work that I was doing.
This was of use: -
and introduced me to PyEnv via Homebrew: -
brew install pyenv
One thing that didn't work was the way that PyEnv sets up $PATH in terms of different Python versions.
Looking at this: -