CustomTkinter icon indicating copy to clipboard operation
CustomTkinter copied to clipboard

Can't use CustomTkinter in Linux Pop Os

Open Barrowcroft opened this issue 10 months ago • 8 comments

When trying to run any of the customtkinter example scripts I get the error:

[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.

I have no idea if this is a Linux problem, Pop Os problem, or tkinter problem. Could anyone help? thanks

Barrowcroft avatar Jan 27 '25 12:01 Barrowcroft

Looking at this further; using the complex_example.py script everything works fine until it reaches:

self.logo_label = customtkinter.CTkLabel(self.sidebar_frame, text="CustomTkinter", font=customtkinter.CTkFont(size=20, weight="bold"))

then the message appears.

Barrowcroft avatar Jan 28 '25 10:01 Barrowcroft

I have the same issue when using python 3.13. The same program works with python 3.12.

Satge96 avatar Mar 07 '25 07:03 Satge96

Having the same issue in Linux Mint t 22.1 Xia as well using Python 3.12.9:

[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.

Dragonrun1 avatar Mar 13 '25 03:03 Dragonrun1

Having the same issue in Arch Linux.

joaovl5 avatar Mar 22 '25 15:03 joaovl5

Having the same issue on Raspberry Pi OS.

KavyanshKhaitan2 avatar Jun 03 '25 08:06 KavyanshKhaitan2

Looking at it further, tk.Label or tk.Button produces the same issue, while ttk.Label and ttk.Button works properly.

KavyanshKhaitan2 avatar Jun 03 '25 08:06 KavyanshKhaitan2

Another thing I noticed. The following code blocks produces the errors:

import customtkinter as ctk

app = ctk.CTk()
app.wm_title("Test window")

ctk.CTkButton(app, text="Hello world!").grid()

app.mainloop()
import customtkinter as ctk
import tkinter as tk

app = ctk.CTk()
app.wm_title("Test window")

ctk.CTkButton(app, text="Hello world!").grid()
tk.Button(app, text="Hello world!").grid()

app.mainloop()

But using TTK instead doesnt produce the same error:

import customtkinter as ctk
from tkinter import ttk

app = ctk.CTk()
app.wm_title("Test window")

ctk.CTkButton(app, text="Hello world!").grid()
ttk.Button(app, text="Hello world!").grid()

app.mainloop()

But this code doesnt produce the error:

import customtkinter as ctk
app = ctk.CTk()
app.wm_title("Test window")
app.mainloop()

And this code does (even without .pack() or .grid()):

import customtkinter as ctk
app = ctk.CTk()
app.wm_title("Test window")
ctk.CTkLabel(app, text="Hello, world!")
app.mainloop()

Please let me know if this is the same result that everybody gets, we might be able to reach somewhere!

KavyanshKhaitan2 avatar Jun 03 '25 08:06 KavyanshKhaitan2

I get the error with this as well:

import customtkinter as ctk
from tkinter import ttk

app = ctk.CTk()
app.wm_title("Test window")

ctk.CTkButton(app, text="Hello world!").grid()
ttk.Button(app, text="Hello world!").grid()

app.mainloop()

only this doesn't result in an error:

import customtkinter as ctk
app = ctk.CTk()
app.wm_title("Test window")
app.mainloop()

klugman-yanai avatar Jun 04 '25 11:06 klugman-yanai