1

I am using uv to manage my python environments and I am getting a low level error message when I try to run a simple tkinter script

#   xxx.py    
import tkinter as tk

def main():
    root = tk.Tk()
  
    label = tk.Label(root, text="This line causes the problem")
    label.pack()
    root.mainloop()

 if __name__ == "__main__":
    main()

When I run the code using

uv run xxx.py 

I get an error message

    ➜ uv run xxx.py             
    Using CPython 3.13.6
    Creating virtual environment at: .venv
    [xcb] Unknown sequence number while appending request
    [xcb] You called XInitThreads, this is not your fault
    [xcb] Aborting, sorry about that.
    python: xcb_io.c:157: append_pending_request: Assertion `!xcb_xlib_unknown_seq_number' failed.

I am NOT using threading!

My system is:

Operating System: Manjaro Linux 
KDE Plasma Version: 6.3.6
KDE Frameworks Version: 6.17.0
Qt Version: 6.9.1
Kernel Version: 6.6.90-1-MANJARO (64-bit)
Graphics Platform: X11
Processors: 20 × 13th Gen Intel® Core™ i5-13500
Memory: 62.5 GiB of RAM

lspci | grep VGA

01:00.0 VGA compatible controller: NVIDIA Corporation AD106 [GeForce RTX 4060 Ti 16GB] (rev a1)

I cannot fathom the problem

1 Answer 1

3

There was recently bug in the uv, it should be solved, but you can have the buggy version on your system.

uv self update
uv python upgrade --reinstall

#clear local .venv if exists
rm -rf .venv

Now you should be able to just run:

uv run xxx.py

or with any particular version you like:

uv run -p 3.13.6 xxx.py
Sign up to request clarification or add additional context in comments.

1 Comment

NB uv and tkinter have some unresolved issues as of now (25 Sept 2025) see this bug report

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.