I tried to run a python script with the code line
from tkinter import Tk
on macOS Sonoma 14.7.1 with python3 version 3.9.1
Running the script produces the following error message:
macOS 14 (1407) or later required, have instead 14 (1406) !
zsh: abort python3 _test.py
but I have macOS 14.7.1 installed.
An installation or unistallation of tk has no influence on the error message.
In a web search I found similar behaviour under macOS 11 and 12, with subversions 6 and 7 as here, but no solution to the problem.