Open oldium opened 10 months ago
This works in PyInstaller's generated exe
because it sets the TCL_LIBRARY and TK_LIBRARY by itself as seen in Process Explorer:
Maybe Python could do the same as PyInstaller does, i.e. set TCL_LIBRARY
and TK_LIBRARY
(and TIX_LIBRARY
?) if they are not already set?
Bug report
Bug description:
I tried to add
widgetPlus
from Tklib and its dependencysnit
from Tcllib to my project, but executingroot.tk.call("package", "require", "widgetPlus")
after instantiatingroot = tkinter.Tk()
failed with Tcl error:Strangely, the same application worked when started as
exe
after PyInstaller was used. I tracked the problem down to the minimal test case (as used by Tcllib modulesnit
):I also found a workaround (I used
glob
to prevent fixing on a particular Tcl/Tk version), which works both in “normal” andvenv
environments:It looks like the Tcl/Tk installation works fine but needs additional configuration on the Python side. And please note that the workaround is usable for the Python's Tcl/Tk installation and does not consider existing Tcl/Tk installations and existing
*_LIBRARY
environmental variables.CPython versions tested on:
3.11, 3.12
Operating systems tested on:
Windows