macOS

If you have multiple versions installed with Brew, you can set the new one as your default:

$ brew unlink python@3.12
$ brew unlink python@3.8
$ brew link --force python@3.12
$ python3 -V
$ which python

If another Python is picked ahead of the Brew versions, check the order of values in PATH and set in your shell config.