-
-
Notifications
You must be signed in to change notification settings - Fork 30.3k
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
win 10 Python-3.13.0 tkinter fails in venv #125235
Comments
FWIW i found that setting TCL_LIBRARY to point at the installation\tcl\tcl8.6 prevents Tk() from raising an exception. However, running my app leaves a command window visible which it should not. I tried running the app directly with python w ie pythonw -mmodule.module.app that still leaves the command window visible. I tried various settings for TK_LIBRARY, but that dis not help. |
Behaviors of TCL paths on Windows are sort of different, they look it up at Line 146 in f9ae5d1
|
My guess is that this requieres a 3.13.1 patch to fix it. |
I see the same failure in Windows 11 as well, running in a venv:
Running in the base Python install works OK. My python.org-installed version is installed for just my user, and I do see the above-mentioned |
… Windows (#125250) Signed-off-by: y5c4l3 <[email protected]>
…ion on Windows (pythonGH-125250) (cherry picked from commit b3aa1b5) Co-authored-by: Y5 <[email protected]> Signed-off-by: y5c4l3 <[email protected]>
On Windows, when I build Python from source, TCL is loaded from Thank you for the bug report and the fix. |
…tion on Windows (GH-125250) (#125312) gh-125235: Keep `_tkinter` TCL paths pointing to base installation on Windows (GH-125250) (cherry picked from commit b3aa1b5) Signed-off-by: y5c4l3 <[email protected]> Co-authored-by: Y5 <[email protected]>
I have this same issue on win11. I also tried to add tcl and tk folders from source into \venv\Lib\site-packages, but it had no effect. |
You should wait for Python 3.13.1 release to get the fix. You can use Python 3.12 in the meanwhile. |
This reverts commit 2fd2b3f because Python 3.13 has a tkinter bug. See details at python/cpython#125235.
I can confirm the above - 3.13.0 Python Tcl wasn't installed properly (I'm using W11, Pycharm, venv). So you either provide paths for your Tkinter projects and keep 3.13.0 - an example below: import os or go back to 3.12. :) |
I have used @replabrobin's workaround (setting environment variables) to mitigate this issue to a large degree. Unfortunately, I have also noticed that this approach
For the record, I believe that is a separate issue, and I just came across #126084 which seems to take care of it. |
Until fixed add the following to your environment variables:
|
Bug report
Bug description:
Installed python 3.13.0 in windows 10 at c:\python313
created venv at c:\users\rptla\tmp\py313
Tkinter based app failed to start in the venv. After testing tkinter I see these results ie error in venv starting Tk() wotks in installed.
In the venv
in installed python
CPython versions tested on:
3.13
Operating systems tested on:
Windows
Linked PRs
_tkinter
TCL paths pointing to base installation on Windows #125250_tkinter
TCL paths pointing to base installation on Windows (GH-125250) #125312The text was updated successfully, but these errors were encountered: