If you get:

Warning: vim has no support for python, but it is required to run the formateter !

Update/Install python with pyenv:

pyenv install 3.11.3

Clone the Vim repository:

git clone https://github.com/vim/vim.git

Configure with python support:

./configure --with-features=huge --enable-multibyte --enable-python3interp

Build and install:

make && sudo make install

Test running from vim:

:echo has('python3')

🔗PyTuple_Type

If get an error about PyTuple_Type, use the system python (not pyenv)