Skip to content

Tkinter not installed correctly on Windows 3.15.0b2 #150836

Description

@terryjreedy

Bug report

Bug description:

3.15.0b1 was fine. 3.15.0b2 will not start tk/tcl. Difference must be incomplete upgrade to tk 9.0.

If I run the REPL with either the Start icon or py in a console, import tkinter works but a subsequent t = tkinter.Text() fails with

Traceback (most recent call last):
  File "<python-input-2>", line 1, in <module>
    t = tkinter.Text()
  File "C:\Programs\Python315\Lib\tkinter\__init__.py", line 3857, in __init__
    Widget.__init__(self, master, 'text', cnf, kw)
    ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Programs\Python315\Lib\tkinter\__init__.py", line 2853, in __init__
    self._setup(master, cnf)
    ~~~~~~~~~~~^^^^^^^^^^^^^
  File "C:\Programs\Python315\Lib\tkinter\__init__.py", line 2818, in _setup
    master = _get_default_root()
  File "C:\Programs\Python315\Lib\tkinter\__init__.py", line 330, in _get_default_root
    root = Tk()
  File "C:\Programs\Python315\Lib\tkinter\__init__.py", line 2535, in __init__
    self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use)
              ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_tkinter.TclError: Can't find a usable tk.tcl in the following directories:
    //zipfs:/app/tk_library //zipfs:/lib/tk/tk_library //zipfs:/lib/tk //zipfs:/lib/tcl/tcl_library/tk9.0 //zipfs:/lib/tcl/tk9.0 C:/Programs/lib/tk9.0 C:/Programs/lib/tk9.0 C:/lib/tk9.0 C:/Programs/library

This probably means that tk wasn't installed properly.

The IDLE icon in the start menu does not work. If I pin it to taskbar and click, the blue circle starts and quickly stops. The one for older versions start, quickly stop, and quickly restart until IDLE runs. In a console, py -m idlelib fails at the same _tkinter.create(...) call with the same message.

I have seen a similar message before and I believe the list of directories is obsolete. In a local build, I believe the tcl/tk file needs to be in PCbuild/. My 3.16 build works fine. Installations used to have DLLs/tcl86t.dll and tk86t.dll. 3.15.0b2 has tcl9tk90.dll and tcl90.dll (no t suffix). Is _tkinter.dll looking for those names?

CPython versions tested on:

3.15

Operating systems tested on:

Windows

Linked PRs

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

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions