Repository navigation
Description
Bug report
Bug description:
Bug description
On Windows 10, tkinter cannot initialize when the official Python 3.14.7
installation is located under a user-profile path containing a space.
Python was installed using the official 64-bit installer with the default
per-user installation options. The issue persisted after completely
uninstalling and reinstalling Python.
The Tcl/Tk archives are present:
tcl\libtcl9.0.4.ziptcl\libtk9.0.4.zip
Running the installation normally fails:
$python = "$env:LOCALAPPDATA\Programs\Python\Python314\python.exe"
& $python -m tkinterThe result is:
_tkinter.TclError: Cannot find a usable init.tcl in the following directories:
<redacted user profile>/AppData/Local/Programs/Python/Python314/lib/tcl9.0
...
This probably means that Tcl wasn't installed properly.
However, mapping the exact same Python installation to a drive letter makes
Tkinter work immediately:
subst T: "$env:LOCALAPPDATA\Programs\Python\Python314"
T:\python.exe -m tkinter
subst T: /dThe Tk demonstration window opens successfully through T:\python.exe.
No Python or Tcl/Tk files are copied or changed between the two tests. The only
difference is whether the same installation is accessed through its original
path, which contains a space, or through a drive-letter path without spaces.
A minimal program produces the same result:
import tkinter as tk
root = tk.Tk()
root.destroy()Expected behavior
tkinter should initialize from the default per-user installation location
even when the Windows account/profile name contains a space.
Actual behavior
tkinter reports that it cannot find a usable init.tcl. Accessing the same
installation through a drive-letter mapping without spaces resolves the
failure.
Reproduction steps
-
Use a Windows account whose user-profile directory contains a space.
-
Install official Python 3.14.7 64-bit using the default per-user options.
-
Run:
& "$env:LOCALAPPDATA\Programs\Python\Python314\python.exe" -m tkinter
-
Observe the
Cannot find a usable init.tclerror. -
Run:
subst T: "$env:LOCALAPPDATA\Programs\Python\Python314" T:\python.exe -m tkinter subst T: /d
-
Observe that Tkinter now starts successfully.
Python version
Python 3.14.7
tags/v3.14.7:823f032
MSC v.1944 64 bit (AMD64)
Operating system
Windows 10 10.0.19045
64-bit
Additional checks
The installed archives exist and are not empty:
libtcl9.0.4.zip 1,121,107 bytes
libtk9.0.4.zip 297,208 bytes
The problem remained after:
- Uninstalling Python 3.14.7
- Reinstalling it with the official installer
- Using the default installation options
- Confirming that the Tcl/Tk component is registered as installed
This appears related to Tcl/Tk 9 ZIP-library discovery or mounting when the
Python installation path contains a space.
Related issues checked
- CPython issue Tkinter - Can't find a usable init.tcl #111754 concerns Tcl library discovery with Python 3.11/3.12
and a different interpreter/path scenario. It does not reproduce this
Python 3.14.7 ZIP-mounting failure or the successfulsubstcomparison. - CPython issue 3.13: cannot run
python -m tkinterdue to missinginit.tcl#126592 concerns a Python 3.13 runtime installed byuv, not
the official Python 3.14.7 Windows installer. - Nuitka issue bpo-31754: Fix the PyBuffer Documentation #3993 concerns Nuitka's build plugin detecting the new zipped
Tcl/Tk layout. In that report, ordinary Python runs Tkinter successfully;
here, ordinary official CPython itself fails until its path has no spaces.
CPython versions tested on:
3.14
Operating systems tested on:
Windows
Activity
im-alok74 commentedon Sep 27, 2026
Hi! I'd like to work on this issue and investigate the Tcl/Tk path-handling problem on Windows, particularly how spaces in the per-user installation path affect ZIP-library discovery.
I can reproduce the issue, investigate the underlying cause, and work on a fix with appropriate tests.
Could you please assign this issue to me? I'd be happy to submit a PR following the project's contribution guidelines.
Thanks!
picnixz commentedon Sep 27, 2026
Does it happen with Python 3.14.6? we updated tkinter to version 9.x on Windows IIRC so it might also be a tkinter issue itself.
picnixz commentedon Sep 27, 2026
And does it happen on Linux as well or other platforms?
saedkh-cell commentedon Sep 28, 2026
@picnixz Thank you for looking into this.
So far, I have reproduced the issue only with the official 64-bit Python
3.14.7 installer on Windows 10. I have not tested Python 3.14.6 or
Linux/other platforms.
The failure appears tied to the Windows per-user installation path containing
a space. The same Python 3.14.7 installation fails from its normal path but
works immediately when accessed through a
substdrive path without spaces.I can test Python 3.14.6 on the same Windows machine if that would be useful.
saedkh-cell commentedon Sep 28, 2026
@picnixz I tested Python 3.14.6 on the same Windows 10 machine.
I assembled an isolated 64-bit Python 3.14.6 runtime from the official
core.msi,exe.msi,lib.msi, andtcltk.msipackages. The temporaryruntime path contained spaces.
Running Tkinter directly from that path failed:
Python 3.14.6 reported Tcl/Tk 8.6, and its Tcl library was present under the
runtime's
tcl\tcl8.6directory.Mapping the identical runtime to
T:and running the same minimal testsucceeded:
Therefore, Python 3.14.6 is affected as well. This also shows that the problem
is not specific to Python 3.14.7's Tcl/Tk 9 ZIP packaging; the common factor is
a space in the Python runtime path.
I have not tested Linux or other platforms. The current reproduction is
Windows-specific.
terryjreedy commentedon Sep 28, 2026
Saed, we don't much assign issues in the sense I think you mean. If the solution to an issue is obvious, we may give a person a week to make a PR. In any case, our principle tkinter maintainer may take a few days or more to look at this. If you find a cause, either post it or a PR and he will eventually review it.