A patched/fixed version of tkinterdnd2 that actually works on Raspberry Pi 5 (arm64) running Debian Trixie.
The official pip install tkinterdnd2 fails on this platform due to tkdnd library compatibility issues (wrong ELF class, version mismatches, etc.).
This repo provides a working replacement.
- Raspberry Pi 5 (8 GB)
- Raspberry Pi OS 64-bit (Debian Trixie / Bookworm successor)
- Python 3.11–3.13 (venv)
- Downgraded to
libtkdnd2.9.2.so(compiled correctly for arm64)- Original 2.9.3 failed with ELF class mismatch
- 2.9.5 also didn't work
- Modified
tkdnd/linux-arm64/pkgIndex.tcl→ changed all2.9.3references to2.9.2
That's it — no other code changes.
- in order to get this to work as it doesn't out of the box, I had to bypass the core drop signal as it kept erroring over e.serial = getint(nsign), _tkinter.TclError: expected integer but got "%#"
- so if you're having issues, check to see that the test script test_tk_dnd.py works and if it does then you have a place to start.
pip install tkinterdnd2in your venv- Copy these files from this repo:
modified_tkinterdnd2/tkdnd/linux-arm64/libtkdnd2.9.2.somodified_tkinterdnd2/tkdnd/linux-arm64/pkgIndex.tcl→ overwrite (must match version)
- Use normal import:
from tkinterdnd2 import TkinterDnD, DND_ALL, ...
- Copy the entire
modified_tkinterdnd2/folder into your project's module directory. Or create a modules directory and put it in your sys.path:import sys sys.path.insert(0, os.path.expanduser("~/your/modules/path"))
- In your script, :
from modified_tkinterdnd2 import TkinterDnD, DND_ALL
Traceback (most recent call last): File "/home/pi/venv/lib/python3.13/site-packages/tkinterdnd2/TkinterDnD.py", line 69, in _require TkdndVersion = tkroot.tk.call('package', 'require', 'tkdnd') _tkinter.TclError: couldn't load file "/home/pi/.venv/lib/python3.13/site-packages/tkinterdnd2/tkdnd/linux-arm64/libtkdnd2.9.3.so": /home/pi/.venv/lib/python3.13/site-packages/tkinterdnd2/tkdnd/linux-arm64/libtkdnd2.9.3.so: wrong ELF class: ELFCLASS64