Skip to content

Not able to run a tkinter program #146

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

Open
yijianli-autra opened this issue Nov 3, 2022 · 29 comments
Open

Not able to run a tkinter program #146

yijianli-autra opened this issue Nov 3, 2022 · 29 comments
Labels
bug Something isn't working

Comments

@yijianli-autra
Copy link

yijianli-autra commented Nov 3, 2022

I am using the bazel/rules_python to compile our python code.
according to the configuration, we are using the
cpython-3.9.13+20220802-x86_64-unknown-linux-gnu-install_only.tar.gz as our python interpreter.
But as we are using the Tkinter, there is a segment fault during the runtime.
the code

import faulthandler
faulthandler.enable()

import tkinter
from tkinter.constants import *
tk = tkinter.Tk()
frame = tkinter.Frame(tk, relief=RIDGE, borderwidth=2)
frame.pack(fill=BOTH,expand=1)
label = tkinter.Label(frame, text="Hello, World")
label.pack(fill=X, expand=1)
button = tkinter.Button(frame,text="Exit",command=tk.destroy)
button.pack(side=BOTTOM)
tk.mainloop()

the stack trace

/tmp/python_interpreter_x86_64-unknown-linux-gnu ❯ ./bin/python3.9 tkinter_test.py                                                                                                                                                                                            
Fatal Python error: Segmentation fault

Current thread 0x00007fe29108ef40 (most recent call first):
  File "/tmp/python_interpreter_x86_64-unknown-linux-gnu/lib/python3.9/tkinter/__init__.py", line 2572 in __init__
  File "/tmp/python_interpreter_x86_64-unknown-linux-gnu/lib/python3.9/tkinter/__init__.py", line 3148 in __init__
  File "/tmp/python_interpreter_x86_64-unknown-linux-gnu/tkinter_test.py", line 9 in <module>
[1]    55139 segmentation fault (core dumped)  ./bin/python3.9 tkinter_test.py

according to other tickets, seems the python interpreter is already linked to the Tkinter.

Update

I was trying to use the debug version to know what happened in the core dump. but it is very strange that I am able to run this with python3.9d. it is very weird.

@indygreg indygreg added the bug Something isn't working label Nov 9, 2022
@indygreg
Copy link
Collaborator

indygreg commented Nov 9, 2022

Thanks for the report.

Can confirm this fails on the latest 20221107 distributions. The x86_64-unknown-linux-gnu distribution fails for me on the >>> label = tkinter.Label(frame, text="Hello, World") line:

>>> label = tkinter.Label(frame, text="Hello, World")
[xcb] Unknown sequence number while appending request
[xcb] Most likely this is a multi-threaded client and XInitThreads has not been called
[xcb] Aborting, sorry about that.
python3: ../../src/xcb_io.c:157: append_pending_request: Assertion `!xcb_xlib_unknown_seq_number' failed.
Fatal Python error: Aborted

Current thread 0x00007f7f676b5c40 (most recent call first):
  File "/home/gps/src/python-build-standalone/dist/python/lib/python3.9/tkinter/__init__.py", line 2572 in __init__
  File "/home/gps/src/python-build-standalone/dist/python/lib/python3.9/tkinter/__init__.py", line 3148 in __init__
  File "<stdin>", line 1 in <module>
Aborted (core dumped)

This program works with other Python builds on my system. So something is amiss.

The xcb warnings point to a potential interaction with that library. I reckon we're missing a configure flag somewhere in the X11 libraries which results in something using a non-standard config. tk and/or CPython is probably making assumptions about some X library config that aren't true.

There's possibly an upstream bug or two to report in here somewhere. But I don't know what until root cause is understood.

@indygreg
Copy link
Collaborator

indygreg commented Nov 9, 2022

Here's an excerpt from libxcb's configure:

Package: libxcb 1.13.1

  Configuration
    XDM support.........: no
    sendmsg fd passing..: yes
    Build unit tests....: no
      with html results.: no
    XCB buffer size.....: 16384

  X11 extensions
    Composite...........: yes

  Package: libxcb 1.13.1

  Configuration
    XDM support.........: no
    sendmsg fd passing..: yes
    Build unit tests....: no
      with html results.: no
    XCB buffer size.....: 16384

  X11 extensions
    Composite...........: yes
Damage..............: yes
    Dpms................: yes
    Dri2................: yes
    Damage..............: yes
    Dpms................: yes
    Dri2................: yes
Dri3................: yes
    GenericEvent........: no
    Glx.................: yes
    Randr...............: yes
    Record..............: yes
    Render..............: yes
    Dri3................: yes
    GenericEvent........: no
    Glx.................: yes
    Randr...............: yes
    Record..............: yes
    Render..............: yes
Resource............: yes
    Screensaver.........: yes
    Resource............: yes
    Screensaver.........: yes
selinux.............: no
    Shape...............: yes
    Shm.................: yes
    Sync................: yes
    Xevie...............: no
    Xfixes..............: yes
    Xfree86-dri.........: yes
    selinux.............: no
    Shape...............: yes
    Shm.................: yes
    Sync................: yes
    Xevie...............: no
    Xfixes..............: yes
    Xfree86-dri.........: yes
xinerama............: yes
    xinput..............: yes
    xkb.................: yes
    xprint..............: no
    xtest...............: yes
    xinerama............: yes
    xinput..............: yes
    xkb.................: yes
    xprint..............: no
    xtest...............: yes
xv..................: yes
    xvmc................: yes

  Used CFLAGS:
    CPPFLAGS............: -fvisibility=hidden -fPIC
    CFLAGS..............: -fvisibility=hidden -fPIC

  Installation:
    Prefix..............: /tools/deps
    xv..................: yes
    xvmc................: yes

  Used CFLAGS:
    CPPFLAGS............: -fvisibility=hidden -fPIC
    CFLAGS..............: -fvisibility=hidden -fPIC

  Installation:
    Prefix..............: /tools/deps

I have no clue how to interpret any of it though.

(I wish all configure scripts gave you concise reports of important metadata like this!)

@indygreg
Copy link
Collaborator

indygreg commented Nov 9, 2022

And from libx11:

11 will be built with the following settings:
 Loadable i18n module support:            no
 Loadable xcursor library support:        yes
 Threading support:                       yes
 Use Threads safe API:                    yes
 Threads stubs in libX11:                 no
 XCMS:                                    yes
 Internationalization support:            yes
 XF86BigFont support:                     yes
 XKB support:                             yes
 XLOCALEDIR environment variable support: yes
 Compose table cache enabled:             yes
 Functional specs building enabled:       yes

X11 will be built with the following settings:
 Loadable i18n module support:            no
 Loadable xcursor library support:        yes
 Threading support:                       yes
 Use Threads safe API:                    yes
 Threads stubs in libX11:                 no
 XCMS:                                    yes
 Internationalization support:            yes
 XF86BigFont support:                     yes
 XKB support:                             yes
 XLOCALEDIR environment variable support: yes
 Compose table cache enabled:             yes
 Functional specs building enabled:       yes

Threads stubs in libX11 seems potentially relevant.

@indygreg
Copy link
Collaborator

indygreg commented Nov 9, 2022

OK. We compile tk with -DTCL_THREADS=1. And we see some code in tk calling XInitThreads() (it is the only caller of XInitThreads() I found outside libX11 source, so I think this is the only relevant caller).

However, that code in tk (unix/tkUnixEvent.c) is protected behind an #if 0 && defined(XKEYCODETOKEYSYM_IS_DEPRECATED) && defined(TCL_THREADS). That will never be true. So we never call XInitThreads().

I think the problem here is we build tcl/tk with support for threads? Is this somehow different from how the entire world builds tcl/tk?

Note that I enabled threads in commit 169bdad. But sadly didn't leave any context. (Very uncharacteristic of me!) Commits around it were part of enabling tcl/tk to build on macOS. I wonder if I enabled threads for a reason or just saw they weren't enabled and figured enabling threads was a good idea?

@indygreg
Copy link
Collaborator

indygreg commented Nov 9, 2022

Hmmm. /usr/lib/x86_64-linux-gnu/tclConfig.sh and /usr/lib/x86_64-linux-gnu/tkConfig.sh on my machine (Ubuntu 22.04) says we built with TCL_THREADS=1. I wonder why my machine's tk is working but this one isn't...

@Edward-Knight
Copy link
Contributor

To add on to the debugging - I cannot reproduce when using xvfb in Docker or otherwise

@dae
Copy link

dae commented Nov 22, 2022

Could it perhaps be related to the change mentioned here? #95 (comment)

@jplumail
Copy link

After a git bisect testing against OP code, I found that this commit is the first bad commit.
I have no idea about how to fix this though !

@ck-google

This comment has been minimized.

@krabhi1

This comment has been minimized.

@zanieb
Copy link
Member

zanieb commented Jan 15, 2025

Just confirming this is still reproducible after upgrading tcl/tk (#495)

❯ uv version
uv 0.5.19
❯ uv python list --show-urls | grep cpython-3.9
cpython-3.9.21-linux-x86_64-gnu                   https://github.com/astral-sh/python-build-standalone/releases/download/20250115/cpython-3.9.21%2B20250115-x86_64-unknown-linux-gnu-install_only_stripped.tar.gz
❯ uv python install --reinstall 3.9 3.13
Installed 2 versions in 3.60s
 ~ cpython-3.9.21-linux-x86_64-gnu
 ~ cpython-3.13.1-linux-x86_64-gnu

❯ uv run -v -p 3.9 script.py
DEBUG uv 0.5.19
DEBUG No project found; searching for Python interpreter
DEBUG Searching for Python 3.9 in virtual environments, managed installations, or search path
DEBUG Searching for managed installations at `/home/zb/.local/share/uv/python`
DEBUG Skipping incompatible managed installation `cpython-3.13.1-linux-x86_64-gnu`
DEBUG Skipping incompatible managed installation `cpython-3.12.8-linux-x86_64-gnu`
DEBUG Found managed installation `cpython-3.9.21-linux-x86_64-gnu`
DEBUG Found `cpython-3.9.21-linux-x86_64-gnu` at `/home/zb/.local/share/uv/python/cpython-3.9.21-linux-x86_64-gnu/bin/python3.9` (managed installations)
DEBUG Using Python 3.9.21 interpreter at: /home/zb/.local/share/uv/python/cpython-3.9.21-linux-x86_64-gnu/bin/python3.9
DEBUG Running `python script.py`
[xcb] Unknown sequence number while appending request
[xcb] You called XInitThreads, this is not your fault
[xcb] Aborting, sorry about that.
python3.9: xcb_io.c:157: append_pending_request: Assertion `!xcb_xlib_unknown_seq_number' failed.
Fatal Python error: Aborted

Current thread 0x00007d0a0c6d6740 (most recent call first):
  File "/home/zb/.local/share/uv/python/cpython-3.9.21-linux-x86_64-gnu/lib/python3.9/tkinter/__init__.py", line 2572 in __init__
  File "/home/zb/.local/share/uv/python/cpython-3.9.21-linux-x86_64-gnu/lib/python3.9/tkinter/__init__.py", line 3148 in __init__
  File "/fast/workspace/python-build-standalone/script.py", line 9 in <module>
DEBUG Command exited with signal: Some(6)

❯ uv run -v -p 3.13 script.py
DEBUG uv 0.5.19
DEBUG No project found; searching for Python interpreter
DEBUG Searching for Python 3.13 in virtual environments, managed installations, or search path
DEBUG Searching for managed installations at `/home/zb/.local/share/uv/python`
DEBUG Found managed installation `cpython-3.13.1-linux-x86_64-gnu`
DEBUG Found `cpython-3.13.1-linux-x86_64-gnu` at `/home/zb/.local/share/uv/python/cpython-3.13.1-linux-x86_64-gnu/bin/python3.13` (managed installations)
DEBUG Using Python 3.13.1 interpreter at: /home/zb/.local/share/uv/python/cpython-3.13.1-linux-x86_64-gnu/bin/python3.13
DEBUG Running `python script.py`
[xcb] Unknown sequence number while appending request
[xcb] You called XInitThreads, this is not your fault
[xcb] Aborting, sorry about that.
python3.13: xcb_io.c:157: append_pending_request: Assertion `!xcb_xlib_unknown_seq_number' failed.
Fatal Python error: Aborted

Current thread 0x00007df5d281d740 (most recent call first):
  File "/home/zb/.local/share/uv/python/cpython-3.13.1-linux-x86_64-gnu/lib/python3.13/tkinter/__init__.py", line 2772 in __init__
  File "/home/zb/.local/share/uv/python/cpython-3.13.1-linux-x86_64-gnu/lib/python3.13/tkinter/__init__.py", line 3361 in __init__
  File "/fast/workspace/python-build-standalone/script.py", line 9 in <module>
DEBUG Command exited with signal: Some(6)

@f1sherb0y
Copy link

f1sherb0y commented Feb 21, 2025

Also met the same issue for this simple program (ubuntu 24.0.1 LTS, amd64):

import tkinter as tk


def show_window(message):
    """Displays a simple tkinter window with a message."""
    root = tk.Tk()
    root.withdraw()  # Hide the root window initially

    window = tk.Toplevel(root)
    window.title("Simple Window")

    label = tk.Label(window, text=message, padx=20, pady=10)
    label.pack()

    ok_button = tk.Button(window, text="OK", command=window.destroy)
    ok_button.pack()

    window.focus_set()  # Request focus for the newly opened window
    window.grab_set()  # Make it modal

    root.wait_window(window)
    root.destroy()
    # window.destroy() # Destroy Toplevel does not actually exit the program.


if __name__ == "__main__":
    message_to_show = "This is a simple window!"
    show_window(message_to_show)

output:

(test) fisherboy@laptop$ cat ./.python-version
3.12
(test) fisherboy@laptop$ cat ./pyproject.toml
[project]
name = "meme"
version = "0.1.0"
description = "Add your description here"
readme = "README.md"
requires-python = ">=3.12"
dependencies = [ ]                  
(test) fisherboy@laptop$ python debug.py
[xcb] Unknown sequence number while appending request
[xcb] You called XInitThreads, this is not your fault
[xcb] Aborting, sorry about that.
python: ../../src/xcb_io.c:157: append_pending_request: Assertion `!xcb_xlib_unknown_seq_number' failed.
Aborted (core dumped)

@linde12
Copy link

linde12 commented Feb 27, 2025

Also encountering this, using Arch (btw), but it is working with python 3.8 and 3.13 (none of which i can use in my project)

test.py:

import tkinter


def main():
    root = tkinter.Tk()
    button = tkinter.Button(root, text="Click Me")
    button.pack(padx=20, pady=20)
    root.mainloop()


if __name__ == "__main__":
    main()
  • uv run -p 3.8 test.py - OK
  • uv run -p 3.9 test.py - Fail
  • uv run -p 3.10 test.py - Fail
  • uv run -p 3.11 test.py - Fail
  • uv run -p 3.12 test.py - Fail
  • uv run -p 3.13 test.py - OK

@rezzubs
Copy link

rezzubs commented Feb 27, 2025

Also encountering this, using Arch (btw), but it is working with python 3.8 and 3.13 (none of which i can use in my project)

See if --python-preference only-managed changes this. For me the system version of 3.13 is okay but the managed one fails (also on arch, in a distrobox though).

For 3.8 I get this traceback

Traceback (most recent call last):
  File "test.py", line 12, in <module>
    main()
  File "test.py", line 5, in main
    root = tkinter.Tk()
  File "/var/home/rezzubs/.local/share/uv/python/cpython-3.8.20-linux-x86_64-gnu/lib/python3.8/tkinter/__init__.py", line 2270, 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: 
    /tools/deps/lib/tcl8.6 /var/home/rezzubs/dev/tkinter-test/.venv/lib/tcl8.6 /var/home/rezzubs/dev/tkinter-test/lib/tcl8.6 /var/home/rezzubs/dev/tkinter-test/.venv/library /var/home/rezzubs/dev/tkinter-test/library /var/home/rezzubs/dev/tkinter-test/tcl8.6.12/library /var/home/rezzubs/dev/tcl8.6.12/library



This probably means that Tcl wasn't installed properly.

later versions fail with:

[xcb] Unknown sequence number while appending request
[xcb] You called XInitThreads, this is not your fault
[xcb] Aborting, sorry about that.
python3: xcb_io.c:157: append_pending_request: Assertion `!xcb_xlib_unknown_seq_number' failed.

@linde12
Copy link

linde12 commented Feb 27, 2025

@rezzubs Ah!

Aha, uv run -p 3.13 --python-preference only-managed test.py does not work either, but with -p 3.8 it worked.

Image

No tcl error (which i've gotten before and worked around using TCL_LIBRARY env var) but reinstalling python 3.8 via uv python uninstall 3.8 and then just running uv run -p 3.8 --python-preference only-managed test.py again broke it.

Perhaps i had a version of py 3.8 that was working, but after uninstalling and letting uv grab the latest 3.8 release it breaks. So basically only my system python & older (?) releases of python-build-standalone are working? :-(

EDIT: I saw that cpython-3.8.20-linux-x86_64-gnu does not work, however 3.8.2 - 3.8.12 are working!

Image

EDIT 2: Can confirm that 3.10.2 & (released in 20220227) works, but so does 3.10.3 (released in 20220318) which was released in the same release as 3.8.13 which does not work!

So two versions from the same release are inconsistent, 3.10.2 works whereas 3.8.13 from same release does not. I am very confused!

@Asachoo
Copy link

Asachoo commented Feb 28, 2025

I encountered a similar issue with tkinter when setting up a new virtual environment using uv. If the error message is:

Traceback (most recent call last):
  File "test.py", line 12, in <module>
    main()
  File "test.py", line 5, in main
    root = tkinter.Tk()
  File "/var/home/rezzubs/.local/share/uv/python/cpython-3.8.20-linux-x86_64-gnu/lib/python3.8/tkinter/__init__.py", line 2270, 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: 
    /tools/deps/lib/tcl8.6 /var/home/rezzubs/dev/tkinter-test/.venv/lib/tcl8.6 /var/home/rezzubs/dev/tkinter-test/lib/tcl8.6 /var/home/rezzubs/dev/tkinter-test/.venv/library /var/home/rezzubs/dev/tkinter-test/library /var/home/rezzubs/dev/tkinter-test/tcl8.6.12/library /var/home/rezzubs/dev/tcl8.6.12/library



This probably means that Tcl wasn't installed properly.

This issue can be resolved by setting the TCL_LIBRARY and TK_LIBRARY environment variables, as suggested in astral-sh/uv#7036 (comment).

However, if the error message is:

[xcb] Unknown sequence number while appending request
[xcb] You called XInitThreads, this is not your fault
[xcb] Aborting, sorry about that.
python3: xcb_io.c:157: append_pending_request: Assertion `!xcb_xlib_unknown_seq_number' failed.

I have not yet found a solution for this particular error.

@Mike710Shine
Copy link

Since managing Python with uv doesn't work when using tkinter, I decided to manage the Python versions with pyenv and that works quite well.I

@linde12
Copy link

linde12 commented Mar 3, 2025

@Mike710Shine interestingly i tried this on my laptop and got the same error, but now when i try on my desktop it works. I must've done something wrong. Are you still able to manage dependencies with uv or you completely went with pyenv?

@Mike710Shine
Copy link

Mike710Shine commented Mar 3, 2025

@linde12 i manage my dependencies with uv but my python installations with chocolatey on windows and on linux with pyenv. First i install pyenv set the string for the fish shell in the config and then i do the rest with uv and it works. I had this tkinter problem only on the Linux Systems

@Mike710Shine
Copy link

I know that pyenv build every python direct from source when i'm right. Maybe it's a good solution that uv has an flag to avoid the installation from the builded source form astral an build it on it's own like pyenv. Maybe this not ends in an not runable tkinter project because i love uv but that i can't run tkinter project when uv manage the python versions only when i use the newest one it is very uncool.

@Mike710Shine
Copy link

Here some screenshots.

Image

Image

Image

@astrojuanlu
Copy link

This probably isn't very useful but the error seems to come from here

https://github.com/mirror/libX11/blob/ff8706a5eae25b8bafce300527079f68a201d27f/src/xcb_io.c#L146-L159

last commit on that file is precisely clarifying the error message we're seeing mirror/libX11@da97120

The maintainers of python-build-standalone have already acknowledged the bug (#146 (comment)) so it's down to someone to find out what's wrong about https://github.com/astral-sh/python-build-standalone/blob/main/cpython-unix/build-libX11.sh, or libX11 itself, or Tcl/Tk, or CPython... probably some very deep debugging required, a bit of luck, or both.

@indygreg
Copy link
Collaborator

indygreg commented Mar 3, 2025

The bug almost certainly reduces to loading multiple versions of a library into a binary or there being a mismatch between the build and run time versions.

@zanieb
Copy link
Member

zanieb commented Mar 3, 2025

I fixed this with ff0ee27 but am not happy with the approach

cc @geofft perhaps you have an idea of how to make that better? I think, at the very least, we should generate the contents replacing the ALL exclusion.

@zanieb
Copy link
Member

zanieb commented Mar 3, 2025

Let's keep conversation here focused on the specific bug here rather than uv Python installation behaviors / pyenv / etc. please.

@linde12
Copy link

linde12 commented Mar 5, 2025

I fixed this with ff0ee27 but am not happy with the approach

cc @geofft perhaps you have an idea of how to make that better? I think, at the very least, we should generate the contents replacing the ALL exclusion.

That commit was included in the latest release, or am i missing something? Because the error still happens with when i install 3.12.9 with uv.

uv grabs python from 20250212 release via https://github.com/astral-sh/python-build-standalone/releases/download/20250212/cpython-3.12.9%2B20250212-x86_64-unknown-linux-gnu-install_only_stripped.tar.gz

~ via 🐍 v3.13.2
❯ uv python install --verbose 3.12.9
DEBUG uv 0.6.4
DEBUG Acquired lock for `.local/share/uv/python`
DEBUG No installation found for request `Python 3.12.9`
DEBUG Found download `cpython-3.12.9-linux-x86_64-gnu` for request `Python 3.12.9`
DEBUG Using request timeout of 30s
Downloading cpython-3.12.9-linux-x86_64-gnu (20.3MiB)
DEBUG Downloading https://github.com/astral-sh/python-build-standalone/releases/download/20250212/cpython-3.12.9%2B20250212-x86_64-unknown-linux-gnu-install_only_stripped.tar.gz to temporary location: /home/linde/.local/share/uv/python/.temp/.tmpGoaoXR
DEBUG Extracting cpython-3.12.9%2B20250212-x86_64-unknown-linux-gnu-install_only_stripped.tar.gz
 Downloaded cpython-3.12.9-linux-x86_64-gnu
DEBUG Moving /home/linde/.local/share/uv/python/.temp/.tmpGoaoXR/python to .local/share/uv/python/cpython-3.12.9-linux-x86_64-gnu
DEBUG Skipping installation of Python executables, use `--preview` to enable.
Installed Python 3.12.9 in 4.48s
 + cpython-3.12.9-linux-x86_64-gnu
DEBUG Released lock at `/home/linde/.local/share/uv/python/.lock`

~ via 🐍 v3.13.2 took 4s
❯ uv run -p 3.12.9 --python-preference only-managed test.py
[xcb] Unknown sequence number while appending request
[xcb] You called XInitThreads, this is not your fault
[xcb] Aborting, sorry about that.
python3.12: xcb_io.c:157: append_pending_request: Assertion `!xcb_xlib_unknown_seq_number' failed.

@charliermarsh
Copy link
Member

No, I don't think that commit has been merged. It's on an open branch.

@linde12
Copy link

linde12 commented Mar 5, 2025

No, I don't think that commit has been merged. It's on an open branch.

Ah, then it makes sense. Thanks!

@rnwolf
Copy link

rnwolf commented Apr 3, 2025

Someone commented that this was not a problem on MS-Windows.
I wanted to say I get the what seems to be the problem on MS-Windows.

❯ uvx --version
uv-tool-uvx 0.6.11 (0632e24d1 2025-03-30)
❯ uvx .\my_tkinter_app-0.1.2-py3-none-any.whl
Installed 3 packages in 1.22s
Traceback (most recent call last):
 File "<frozen runpy>", line 198, in _run_module_as_main
 File "<frozen runpy>", line 88, in _run_code
 File "C:\Users\rnwol\AppData\Local\uv\cache\archive-v0\u-Iv1TOsu8C9Esopv3qX4\Scripts\my-tkinter-app.exe\__main__.py", line 10, in <module>
   sys.exit(main())
            ~~~~^^
 File "C:\Users\rnwol\AppData\Local\uv\cache\archive-v0\u-Iv1TOsu8C9Esopv3qX4\Lib\site-packages\my_tkinter_app\app.py", line 24, in main
   controller = MainController()
 File "C:\Users\rnwol\AppData\Local\uv\cache\archive-v0\u-Iv1TOsu8C9Esopv3qX4\Lib\site-packages\my_tkinter_app\controller\main_controller.py", line 7, in __init__
   self.view = MainView(self)
               ~~~~~~~~^^^^^^
 File "C:\Users\rnwol\AppData\Local\uv\cache\archive-v0\u-Iv1TOsu8C9Esopv3qX4\Lib\site-packages\my_tkinter_app\view\main_view.py", line 5, in __init__
   super().__init__()
   ~~~~~~~~~~~~~~~~^^
 File "C:\Users\rnwol\AppData\Roaming\uv\python\cpython-3.13.0-windows-x86_64-none\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/rnwol/AppData/Roaming/uv/python/cpython-3.13.0-windows-x86_64-none/lib/tcl8.6 C:/Users/rnwol/AppData/Roaming/uv/python/lib/tcl8.6 C:/Users/rnwol/AppData/Roaming/uv/lib/tcl8.6 C:/Users/rnwol/AppData/Roaming/uv/python/library C:/Users/rnwol/AppData/Roaming/uv/library C:/Users/rnwol/AppData/Roaming/uv/tcl8.6.12/library C:/Users/rnwol/AppData/Roaming/tcl8.6.12/library

But if I specify the python version installed from https://www.python.org/downloads/

❯ uvx -p "C:\Python313\python.exe" .\my_tkinter_app-0.1.3-py3-none-any.whl
Installed 3 packages in 1.25s

The application is a basic TKinter app. https://github.com/rnwolf/my_tkinter_app

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests