[issue44253] tkinter searches for tk.tcl in wrong directory

2021-05-28 Thread Adam Stewart
Adam Stewart added the comment: Thanks, that does help. Spack uses both `--with-tcltk-includes` and `--with-tcltk-libs`, and actually RPATHs the libraries in place. According to otool, that is all working fine: $ otool -L

[issue44253] tkinter searches for tk.tcl in wrong directory

2021-05-28 Thread Ned Deily
Ned Deily added the comment: Correction: "In a standard Python build, tkinter has a Python component that calls a private C-language extension module helper named _tkinter that does all the C-level calls to Tk and Tcl [not Tkinter!]." -- ___

[issue44253] tkinter searches for tk.tcl in wrong directory

2021-05-28 Thread Ned Deily
Ned Deily added the comment: tkinter does not find Tk; the linker at build time (ld) and usually the dynamic linker (dyld) at run time do all the work. Typically on macOS, the linkers prefer to dynamically link to libraries, deferring the decision to dyld at run time exactly which dynamic

[issue44253] tkinter searches for tk.tcl in wrong directory

2021-05-28 Thread Adam Stewart
Adam Stewart added the comment: And... now it's not working again. Can you clarify exactly how tkinter finds tk/tcl? Does it rely on TCL_LIBRARY or TK_LIBRARY env vars? TCLLIBPATH? If I use all of these env vars, tkinter finds tcl/tk, but commands like: $ python -m tkinter $ python -c

[issue44253] tkinter searches for tk.tcl in wrong directory

2021-05-27 Thread Adam Stewart
Adam Stewart added the comment: I think I FINALLY figured out the problem. We were setting `TCLLIBPATH` to `/lib/tk8.6` when it should be `/lib`. With this change, tkinter seems to work for me. Thanks for all of your help! -- ___ Python tracker

[issue44253] tkinter searches for tk.tcl in wrong directory

2021-05-27 Thread Adam Stewart
Adam Stewart added the comment: Thanks, in that case it sounds like the problem is that Spack installs tcl and tk to separate directories, but since tk depends on tcl and not the other way around, tcl has no way of knowing where tk is installed. I'll see if I can convince the other Spack

[issue44253] tkinter searches for tk.tcl in wrong directory

2021-05-27 Thread Ned Deily
Ned Deily added the comment: The message is coming from Tcl/Tk; tkinter is just passing it along and is otherwise not involved AFAIK. You don't need to use framework builds for Tcl or Tk on macOS but you should follow the recommendation of how to do a Unix build of Tcl and Tk as far as

[issue44253] tkinter searches for tk.tcl in wrong directory

2021-05-27 Thread Adam Stewart
New submission from Adam Stewart : I'm trying to install Python with tkinter support using the Spack package manager. Spack adds the following flags to configure during install: ```