I'm trying to run a simple program to verify the customtkinter package installation on a raspberry pi 4b.
I've installed the packages and tested it with the simple program found the offical customtkinter website.
import customtkinter
def button_callback():
print("button clicked")
app = customtkinter.CTk()
app.geometry("400x150")
button = customtkinter.CTkButton(app, text="my button", command=button_callback)
button.pack(padx=20, pady=20)
app.mainloop()
The program bombs, giving this error:
Traceback (most recent call last):
File "/home/tsc/Desktop/Feeder/simple.py", line 6, in <module>
app = customtkinter.CTk()
^^^^^^^^^^^^^^^^^^^
File "/home/tsc/Desktop/Feeder/customtkinter/windows/ctk_tk.py", line 41, in __init__
TK_CLASS.__init__(self, **pop_from_dict_by_set(kwargs, self._valid_tk_constructor_arguments))
File "/home/tsc/feed/lib/python3.11/site-packages/tkinterDnD/tk.py", line 36, in __init__
self.TkDnDVersion = _init_tkdnd(self)
^^^^^^^^^^^^^^^^^
File "/home/tsc/feed/lib/python3.11/site-packages/tkinterDnD/tk.py", line 28, in _init_tkdnd
TkDnDVersion = master.tk.call('package', 'require', 'tkdnd')
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_tkinter.TclError: couldn't load file "/home/tsc/feed/lib/python3.11/site-packages/tkinterDnD/linux/libtkdnd2.9.2.so": /home/tsc/feed/lib/python3.11/site-packages/tkinterDnD/linux/libtkdnd2.9.2.so: cannot open shared object file: No such file or directory
I've ran this same code on my mac, and it runs just fine.
Here's the pi's specs:
pi 4b with the latest Raspberry Pi OS with desktop:
Release date: October 10th 2023
System: 64-bit
Kernel version: 6.1
Debian version: 12 (bookworm)
I used pip list to get the installed packages on the mac, and used that to install the same packages on the pi.
(feed) tsc@tsc:~/Desktop/Feeder $ pip list
Package Version
------------- ---------
certifi 2023.7.22
configparser 6.0.0
customtkinter 5.2.1
darkdetect 0.8.0
Pillow 10.1.0
pip 23.0.1
python-tkdnd 0.2.1
pyusb 1.2.1
setuptools 66.1.1
tk 0.1.0
tkinterdnd2 0.3.0
ttkwidgets 0.13.0
Here's whats on the mac.
r-iMac:Feeder r$ pip list
Package Version
------------- ----------
certifi 2020.4.5.2
configparser 6.0.0
customtkinter 5.2.0
darkdetect 0.8.0
Pillow 10.0.0
pip 23.2.1
python-tkdnd 0.2.1
pyusb 1.2.1
setuptools 41.2.0
tk 0.1.0
tkinterdnd2 0.3.0
ttkwidgets 0.13.0
I reinstalled the pi OS, and created several venv's, reinstalling all the packages from scratch and I still get the same error.
Any and all help will be greatly appreciated.