If you have upgraded to MacOs Sequoia like I did and found out that pyenv and other Python stuff doesn’t not work ( including compiling ) this is for you. This has been updated to cover general pyenv troubleshooting since its no longer relevant fo Sequoia.
I spent way too much time trying to get a MacOs Beta to install Python properly with pyenv and compiling and installing a binary ( when available ). So I took the logical (?) approach and installed UTM, installed an M1 vm and compiled from scratch to get the binaries and then installed those on my Beta MacOs and its working.
Here are my steps. Feel free to tell me I am wrong about something and I could have done better.