Skip to content

Python 3.14.7 tkinter fails when per-user installation path contains a space #158178

Description

@saedkh-cell

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.zip
  • tcl\libtk9.0.4.zip

Running the installation normally fails:

$python = "$env:LOCALAPPDATA\Programs\Python\Python314\python.exe"
& $python -m tkinter

The 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: /d

The 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

  1. Use a Windows account whose user-profile directory contains a space.

  2. Install official Python 3.14.7 64-bit using the default per-user options.

  3. Run:

    & "$env:LOCALAPPDATA\Programs\Python\Python314\python.exe" -m tkinter
  4. Observe the Cannot find a usable init.tcl error.

  5. Run:

    subst T: "$env:LOCALAPPDATA\Programs\Python\Python314"
    T:\python.exe -m tkinter
    subst T: /d
  6. 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 versions tested on:

3.14

Operating systems tested on:

Windows

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions