Hey everyone! I'm working on a cool project called Pi-Deck that requires a GUI on my Raspberry Pi 4, and I chose CustomTkinter for its customization options. However, I've run into some issues getting it to work properly. Here's the code I'm using:
```python
import customtkinter as ctk
app = ctk.CTk()
app.wm_title("Test window")
ctk.CTkLabel(app, text="Hello, world!")
app.mainloop()
```
When I try to run it, I get this error:
```
pi@pi:~/code/pideck $ uv run test.py
[xcb] Unknown sequence number while appending request
[xcb] You called XInitThreads, this is not your fault
[xcb] Aborting, sorry about that.
python3: ../../src/xcb_io.c:157: append_pending_request: Assertion `!xcb_xlib_unknown_seq_number' failed.
pi@pi:~/code/pideck $
```
Can anyone suggest how to fix this?
1 Answer
It seems like your Raspberry Pi desktop environment might be running Wayland instead of X11, and CustomTkinter is trying to run as an X11 application. To fix this, you can switch your desktop session to use X11. When you boot up your Raspberry Pi, look for an option in the login screen to select your session type. Pick 'X11' and see if that resolves the issue!
Is that really the problem? I'm using the latest Pi desktop with default settings. If that's it, how can I switch to X11? I’ve heard others are having this same issue too.