If you ever need it on an old version like python 3.12 for example.
pyenv uninstall 3.12.12 # uninstall the current version sudo apt install tk-dev # It includes all dependencies needed pyenv install 3.12.12 # Run install again to compile