MacOS Ventura Python version?

I seem to have multiple versions of Python 3 installed, and my PATH is (by default) pointing at an out of date version.

➜ where python3
/Library/Frameworks/Python.framework/Versions/3.9/bin/python3
/usr/local/bin/python3
/usr/bin/python3

The second one is a symlink to the first, and is version 3.9.0.

The third result is a binary - version 3.9.6 - perhaps I installed the official package at some point?

I have brew installed, but I haven't installed Python 3 with that so far.

My $PATH is a complete mess, with /usr/local/bin before /usr/bin... surely that's not right?

➜ echo $PATH
/opt/homebrew/bin:/opt/homebrew/sbin:/Users/rick/.npm-global/bin:/Library/Frameworks/Python.framework/Versions/3.9/bin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/go/bin:/Library/Apple/usr/bin:/Users/rick/go/bin:/Users/rick/Library/Python/3.9/bin:/Users/rick/Library/Python/3.9/lib/python/site-packages:/Users/rick/bin:/Users/rick/.fzf/bin

I know how to fix all of this manually... I'm just wondering how I might have arrived at this state?

And, of the 3 possible sources of Python 3 for MacOS (Homebrew, Official Python Package, the one maintained in the OS) which is the better one to rely on?

I followed the instructions at https://opensource.com/article/19/5/python-3-default-mac#what-to-do which basically say install and use pyenv with homebrew.

MacOS Ventura Python version?
 
 
Q