[Pythonmac-SIG] Trouble building tkinter for Aqua

Matthew Dixon Cowles matt at mondoinfo.com
Thu Dec 7 17:18:03 EST 2023


I'm trying to compile Python 3.12.0 from source on a new ARM MacBook.
I haven't had any trouble except with the tkinter module. I've built
Python from source any number of times before on Linux and macOS, but
previously always with X11. (For the moment, I'm just doing an
ordinary Unix build, not a Framework build.)

I've built Tcl and Tk (with --enable-aqua) and the tests run. (Tk
seems unhappy with a few of the window manager tests but they don't
seem like a big deal and nothing blows up.) The libraries are in
/usr/local/lib:

$ ls -l /usr/local/lib/libtk8.6.dylib 
-r-xr-xr-x  1 root  staff  1572304 Dec  6 22:50
/usr/local/lib/libtk8.6.dylib
$ ls -l /usr/local/lib/libtcl8.6.dylib
-r-xr-xr-x  1 root  staff  1558656 Dec  6 17:58
/usr/local/lib/libtcl8.6.dylib

But when I run configure, I get:

checking for stdlib extension module _tkinter... missing

At the bottom of configure's output, I get:

configure: WARNING: pkg-config is missing. Some dependencies may not
be detected correctly.

So I've tried hand-hacking the Makefile, replacing:

MODULE__TKINTER_STATE=missing

with:

MODULE__TKINTER_STATE=yes
MODULE__TKINTER_CFLAGS=
MODULE__TKINTER_LDFLAGS=-ltk8.6 -ltcl8.6

But then make gives me:

[ERROR] _tkinter
(/usr/local/src/Python-3.12.0/build/lib.macosx-14.1-arm64-
3.12/_tkinter.cpython-312-darwin.so) is missing

which suggests that the build process didn't try to build that module.

Is there some trick that I'm missing? Some additional bit of fiddling
I need to do to get the build process to try to build tkinter?

Thanks!

Regards,
Matt



More information about the Pythonmac-SIG mailing list