Skip to content

Tkinter does not run in 3.13.0 #125179

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
litiegang1989 opened this issue Oct 9, 2024 · 6 comments
Closed

Tkinter does not run in 3.13.0 #125179

litiegang1989 opened this issue Oct 9, 2024 · 6 comments
Labels
3.13 bugs and security fixes topic-tkinter type-bug An unexpected behavior, bug, or error

Comments

@litiegang1989
Copy link

litiegang1989 commented Oct 9, 2024

Bug report

Bug description:

I can not use Tkinter in the version of 3.13.0, even if I just import tkinter will have a wrong. I try to run the program on two different laptops, and have the same problem.

from tkinter import *

Process finished with exit code -1073741819 (0xC0000005)


### CPython versions tested on:

3.13

### Operating systems tested on:

Windows
@litiegang1989 litiegang1989 added the type-bug An unexpected behavior, bug, or error label Oct 9, 2024
@ZeroIntensity ZeroIntensity added topic-tkinter 3.13 bugs and security fixes labels Oct 9, 2024
@terryjreedy
Copy link
Member

Works fine for me when installed with the new python.org installer.

C:\Users\Terry>py
Python 3.13.0 (tags/v3.13.0:60403a5, Oct  7 2024, 09:38:07) [MSC v.1941 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from tkinter import *
>>> dir()
['ACTIVE', 'ALL', 'ANCHOR', 'ARC', 'BASELINE', 'BEVEL', 'BOTH', 'BOTTOM', 'BROWSE', 'BUTT', 'BaseWidget', 'BitmapImage', 'BooleanVar', 'Button', 'CASCADE', 'CENTER', 'CHAR', 'CHECKBUTTON', 'CHORD', 'COMMAND', 'CURRENT', 'CallWrapper', 
<...>
'image_names', 'image_types', 'mainloop']
>>>

Please give exact details of how you got your python binary and exact how you ran it.

Note: the triple backticks should enclose code and output but not the template headings and responses.

@terryjreedy terryjreedy added the pending The issue will be closed if no feedback is provided label Oct 9, 2024
@terryjreedy terryjreedy changed the title Tkinter can not use in the version of 3.13.0 Tkinter does not run in 3.13.0 Oct 9, 2024
@colesbury
Copy link
Contributor

Did you install the free-threaded binaries? Tkinter is broken on free-threaded Windows 3.13t: #118973

@terryjreedy
Copy link
Member

terryjreedy commented Oct 9, 2024

I have been running IDLE on locally built free-threading builds since March 15 this year, so this is a packaging issue.

Python 3.14.0a0 experimental free-threading build (heads/main:440632adb29, Oct  9 2024, 10:25:28) [MSC v.1941 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import tkinter
>>> dir()
['__builtins__', '__cached__', '__doc__', '__file__', '__loader__', '__name__', '__package__', '__spec__', 'tkinter']

@joshburnett
Copy link

joshburnett commented Oct 9, 2024

I see this issue when running Python from within a venv:

Python 3.13.0 (tags/v3.13.0:60403a5, Oct  7 2024, 09:38:07) [MSC v.1941 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import tkinter
>>> root = tkinter.Tk()
Traceback (most recent call last):
  File "<python-input-2>", line 1, in <module>
    root = tkinter.Tk()
  File "C:\Users\jburnett1\AppData\Local\Programs\Python\Python313\Lib\tkinter\__init__.py", line 2459, in __init__
    self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use)
              ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_tkinter.TclError: Can't find a usable init.tcl in the following directories:
    C:/Users/MY_USER_NAME/AppData/Local/Programs/Python/Python313/lib/tcl8.6 C:/Users/jburnett1/AppData/Local/Programs/Python/lib/tcl8.6 C:/Users/MY_USER_NAMEAppData/Local/Programs/lib/tcl8.6 C:/Users/MY_USER_NAME/AppData/Local/Programs/Python/library C:/Users/MY_USER_NAME/AppData/Local/Programs/library C:/Users/MY_USER_NAME/AppData/Local/Programs/tcl8.6.14/library C:/Users/MY_USER_NAME/AppData/Local/tcl8.6.14/library

Running in the base Python install works OK. I'm not running the free-threaded build.

I'm testing on Windows 11, though I've seen a report of this on Windows 10 as well.

Also worth noting that I ran into this issue with the binary from the python.org installer as well as installing Python via UV.

My python.org-installed version is installed for just my user, and I do see the above-mentioned init.tcl file in C:\Users\MY_USER_NAME\AppData\Local\Programs\Python\Python313\tcl\tcl8.6 but this directory is not listed in the traceback as one of the ones being searched.

@litiegang1989
Copy link
Author

20241010-071407
I download the installer from the official site.I test again on Windows 11, If I install with the option clicked, it will have this problem. If I install without download free-threaded binaries, tkinter can run normally.

@terryjreedy terryjreedy closed this as not planned Won't fix, can't repro, duplicate, stale Oct 10, 2024
@terryjreedy
Copy link
Member

terryjreedy commented Oct 10, 2024

@joshburnett Please open a separate issue for failures, if any, that only occur with venv. Reference threads on discuss.python.org if this is claimed.

EDIT: Robin Becker opened #125235. Fix in 3.13.1.

@zware zware removed the pending The issue will be closed if no feedback is provided label Nov 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.13 bugs and security fixes topic-tkinter type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

6 participants