question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Compile seems to not include tkdnd package needed for tkinterdnd2

See original GitHub issue

Nutika version:

0.7.7 Commercial: None Python: 3.10.4 (tags/v3.10.4:9d38120, Mar 23 2022, 23:13:41) [MSC v.1929 64 bit (AMD64)] Flavor: Unknown Executable: C:\Users\Steven\AppData\Local\Programs\Python\Python310\python.exe OS: Windows Arch: x86_64 WindowsRelease: 10

nuitka and tkinterdnd2 were installed through pip install, on pip 22.1.

Target Test.py:

from tkinterdnd2 import *

ws = TkinterDnD.Tk()

ws.mainloop()

Commands used:

   python -m nuitka --follow-imports --standalone --enable-plugin=tk-inter Test.py
   python -m nuitka --follow-imports --onefile --enable-plugin=tk-inter Test.py

Compiling seems to work fine but when the .exe is opened it produces the following error:

Traceback (most recent call last):
  File "C:\Users\Steven\AppData\Local\Temp\ONEFIL~1\tkinterdnd2\TkinterDnD.py", line 53, in _require
_tkinter.TclError: can't find package tkdnd

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\Steven\AppData\Local\Temp\ONEFIL~1\Test.py", line 4, in <module>
    ws = TkinterDnD.Tk()
  File "C:\Users\Steven\AppData\Local\Temp\ONEFIL~1\tkinterdnd2\TkinterDnD.py", line 285, in __init__
  File "C:\Users\Steven\AppData\Local\Temp\ONEFIL~1\tkinterdnd2\TkinterDnD.py", line 55, in _require
RuntimeError: Unable to load tkdnd library.

This issue only happens when --standalone or --onefile is used, running a compile without them works completely fine and starts the .exe as intended.

I’m not quite sure why this error occurs, any insights on it would be welcome.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
kayhayencommented, May 13, 2022

Check it out from here: https://nuitka.net/doc/factory.html

0reactions
kayhayencommented, May 20, 2022

Part of 0.8 release that I just made.

Read more comments on GitHub >

github_iconTop Results From Across the Web

(Pyinstaller) 'tclError: can't find package tkdnd' How can I fix ...
I have a project which uses TkinterDnD2. I build it with PyInstaller and see the same error you see (more or less). Running...
Read more >
Can't Compile TKinterDND3/tkdnd library into python exe file
This means a particular module ('x' in this case) was not added to the package. I have seen this occur with packages in...
Read more >
python-tkdnd - PyPI
A nice and easy-to-use wrapper around the tkdnd package. No tcl installation, no build is required, just install and use it!
Read more >
Issue 40893: tkinter: integrate TkDND support - Python tracker
I have got it working but I don't really understand how the installer works and it is ... it seems pointless to package...
Read more >
How to Install and Use TkDnD with Python Tkinter on OSX?
By the way, placing the TkinterDnD2 Python wrapper in /Library/Frameworks/Python.framework/Versions/.../lib/python/site-packages still works on Catalina. Just ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found