I use my old Dell laptop (running KUbuntu 26.04 LTS & X11 instead of Wayland) almost entirely to build and test Python from GitHub. This morning, I got an error for test_tkinter. Running that in isolation, I noticed that several tests were skipped because Tcl/Tk >= 8.7 wasn’t installed. apt told me I had Tcl/Tk 9.0 available, but nothing later than the 8.6 release in the 8.x series. (8.6 seems to be required for the KUbuntu desktop.) I installed the 9.0 bits:
$ apt search tcl | grep installed
WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
deja-dup/resolute,now 50.0-3 amd64 [installed,automatic]
libgedit-gtksourceview-300-common/resolute,now 299.5.0-4 all [installed,automatic]
libtcl8.6/resolute,now 8.6.17+dfsg-1build1 amd64 [installed,automatic]
libtcl9.0/resolute,now 9.0.3+dfsg-1 amd64 [installed,automatic]
libtk8.6/resolute,now 8.6.17-1build1 amd64 [installed,automatic]
libtk9.0/resolute,now 9.0.3-1 amd64 [installed,automatic]
tcl/resolute,now 8.6.16build1 amd64 [installed,automatic]
tcl8.6/resolute,now 8.6.17+dfsg-1build1 amd64 [installed,automatic]
tcl9.0/resolute,now 9.0.3+dfsg-1 amd64 [installed,automatic]
tcl9.0-dev/resolute,now 9.0.3+dfsg-1 amd64 [installed]
tk/resolute,now 8.6.16build1 amd64 [installed,automatic]
tk8.6/resolute,now 8.6.17-1build1 amd64 [installed,automatic]
tk9.0/resolute,now 9.0.3-1 amd64 [installed,automatic]
tk9.0-dev/resolute,now 9.0.3-1 amd64 [installed]
yt-dlp/resolute,now 2026.03.17-1 all [installed,automatic]
but configure tells me tcl.h wasn’t found, though there is one in the Tcl 9.0 install:
$ sudo find / -name tcl.h 2>/dev/null
/usr/include/tcl9.0/tcl-private/generic/tcl.h
/usr/include/tcl9.0/tcl.h
pkg-config shows me the necessary 9.0 bits seem to be available:
$ pkg-config --list-all | egrep 'tcl|tk'
tk9.0 The Tk Toolkit - Tk is a cross-platform graphical user interface toolkit, the standard GUI not only for Tcl, but for many other dynamic languages as well.
tcl9.0 Tool Command Language - Tcl is a powerful, easy-to-learn dynamic programming language, suitable for a wide range of uses.
It seems configure doesn’t know about Tcl/Tk 9.0 yet. In fact, though some tests require Tcl/Tk >= 8.7, it seems configure doesn’t even check for that. From configure.ac:
dnl Detect Tcl/Tk. Use pkg-config if available.
dnl
found_tcltk=no
for _QUERY in \
"tcl >= 8.5.12 tk >= 8.5.12" \
"tcl8.6 tk8.6" \
"tcl86 tk86" \
"tcl8.5 >= 8.5.12 tk8.5 >= 8.5.12" \
"tcl85 >= 8.5.12 tk85 >= 8.5.12" \
; do
PKG_CHECK_EXISTS([$_QUERY], [
PKG_CHECK_MODULES([TCLTK], [$_QUERY], [found_tcltk=yes], [found_tcltk=no])
])
AS_VAR_IF([found_tcltk], [yes], [break])
done
Am I missing something obvious? Is there a way to build Python on Ubuntu variants using Tcl/Tk 9.0?