#3993·Nuitka

tk-inter 无法在官方 Windows Python 3.14.7 中检测压缩的 Tcl/Tk 库

作者: daddun创建于 2026年8月8日更新于 2026年9月8日
标签bugexcellent_report

Bug Description On Windows with the official CPython 3.14.7 x86 installer, Tcl/Tk script libraries are shipped as libtcl9.0.4.zip and libtk9.0.4.zip. The tk-inter plugin only searches for unpacked directories containing init.tcl and dialog.tcl, so standalone compilation fails with Could not find Tcl. This reproduces with stable Nuitka 4.1.3 and with the current develop branch (4.2rc3, commit fab23b052dae7e183897ab3d0769cf9ade6a7227). I searched existing issues. #3884 is related to Tcl 9 selection on Linux, but this report is specifically about the zipped Tcl/Tk layout of the official Windows CPython 3.14.7 distribution. ## ️ Environment ### 1. Nuitka Version, Python Version, OS, and Platform Current develop: text 4.2rc3 Update status: newer than stable release '4.1.3'. Commercial: None Python: 3.14.7 (tags/v3.14.7:823f032, Aug 5 2026, 10:40:08) [MSC v.1944 32 bit (Intel)] Flavor: CPython Official GIL: yes Executable: ~\AppData\Local\Programs\Python\Python314-32\Python.exe OS: Windows Arch: x86 WindowsRelease: 10 Version C compiler: cl (cl 14.5). Stable Nuitka 4.1.3 produces the same fatal error. ### 2. How Nuitka and Python were Installed - Python 3.14.7 x86: official CPython Windows installer - Nuitka 4.1.3: pip - Nuitka develop: shallow clone of Nuitka/Nuitka, placed first on PYTHONPATH - No virtual environment was used for this reproduction ### 3. Relevant PyPI Packages and Versions No third-party runtime packages are required. The reproducer only imports the standard-library tkinter package. ## ️ To Reproduce ### 1. "Hello World" Test The following compiles successfully in standalone mode with the same Nuitka develop checkout and compiler: Python print("hello world") ### 2. Short, Self-Contained, Correct, Eligible (SSCCE) Example Python # nuitka-project: --enable-plugin=tk-inter import tkinter print(tkinter.TclVersion) Running it with standard Python succeeds and prints: text 9.0 ### 3. Nuitka Command Line Options powershell Python -m nuitka --standalone tk_probe.py The relevant Python installation layout is: text <Python prefix>\tcl\ libtcl9.0.4.zip libtk9.0.4.zip tk9.0 These expected unpacked files do not exist: <Python prefix>\tcl\tcl9.0\init.tcl <Python prefix>\tcl\tk9.0\dialog.tcl The archives contain: libtcl9.0.4.zip -> tcl_library/init.tcl libtk9.0.4.zip -> tk_library/dialog.tcl ## Expected Behavior The tk-inter plugin should detect the zipped Tcl/Tk layout used by this official CPython build, include the contained runtime files, and complete standalone compilation. ## Actual Behavior & Output Stable 4.1.3 and develop 4.2rc3 both fail during plugin data-file discovery: text FATAL: tk-inter: Could not find Tcl, you might need to use '--tcl-library-dir' and if that works, report a bug so it can be added to Nuitka. Nuitka-Reports: Compilation crash report written to file …