_tkinter.TclError: can't find package tkdnd

158 views
Skip to first unread message

xiaor...@gmail.com

unread,
Jan 22, 2019, 4:34:40 AM1/22/19
to PyInstaller
Hello Sir,

I just started to study python and tring to make some little tools for myslef.

My script was working well with python3.6 and pycharm, but not working with pyinstaller and shows error info below,

would you please to give me a clue where i should start to fix it ?

Traceback (most recent call last):
  File "TkinterDnD2\TkinterDnD.py", line 39, in _require
_tkinter.TclError: can't find package tkdnd

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "dropbox.py", line 170, in <module>
  File "dropbox.py", line 19, in __init__
  File "TkinterDnD2\TkinterDnD.py", line 271, in __init__
  File "TkinterDnD2\TkinterDnD.py", line 41, in _require
RuntimeError: Unable to load tkdnd library.
[12172] Failed to execute script dropbox

Rob Hulley

unread,
Sep 25, 2019, 12:12:37 PM9/25/19
to PyInstaller
I had this same issue.
I found if you copy the tkdnd2.8 folder into the tcl8.6 folder it solves the error.
I renamed mine to just tkdnd

The tk8.6 folder is copied into the bunldle of software in the compile.
The folders above this are not copies.

Hope this helps

    Directory: C:\Users\Hu....\AppData\Local\Programs\Python\Python37\tcl


Mode                LastWriteTime         Length Name
----                -------------         ------ ----
d-----       25/07/2019     21:06                dde1.4
d-----       25/07/2019     21:06                nmake
d-----       25/07/2019     21:06                reg1.3
d-----       25/07/2019     21:06                tcl8
d-----       23/09/2019     18:14                tcl8.6
d-----       25/07/2019     21:06                tix8.4.3
d-----       25/07/2019     21:06                tk8.6
d-----       27/07/2019     20:40                tkdnd2.8       <=== copy this folder into tcl8.6 folder
-a----       25/03/2019     21:25         184460 tcl86t.lib
-a----       25/03/2019     21:25           7558 tclConfig.sh
-a----       25/03/2019     21:25            773 tclooConfig.sh
-a----       25/03/2019     21:25         826872 tclstub86.lib
-a----       25/03/2019     21:25         124930 tk86t.lib
-a----       25/03/2019     21:25         442812 tkstub86.lib


PS C:\Users\Hu....\AppData\Local\Programs\Python\Python37\tcl> dir tcl8.6


    Directory: C:\Users\Hu....\AppData\Local\Programs\Python\Python37\tcl\tcl8.6


Mode                LastWriteTime         Length Name
----                -------------         ------ ----
d-----       25/07/2019     21:06                encoding
d-----       25/07/2019     21:06                http1.0
d-----       25/07/2019     21:06                msgs
d-----       25/07/2019     21:06                opt0.4
d-----       23/09/2019     17:51                tkdnd      <=== I renamed it to tkdnd, not sure if this rename is necessary
d-----       25/07/2019     21:06                tzdata
-a----       25/03/2019     21:25          21148 auto.tcl
-a----       25/03/2019     21:25         128934 clock.tcl
-a----       25/03/2019     21:25           7900 history.tcl
-a----       25/03/2019     21:25          24432 init.tcl
-a----       25/03/2019     21:25          22959 package.tcl
-a----       25/03/2019     21:25            816 parray.tcl
-a----       25/03/2019     21:25          33439 safe.tcl
-a----       25/03/2019     21:25           5415 tclIndex
-a----       25/03/2019     21:25          11633 tm.tcl
-a----       25/03/2019     21:25           4860 word.tcl

Rob Hulley

unread,
Sep 25, 2019, 12:18:35 PM9/25/19
to PyInstaller
Reply all
Reply to author
Forward
0 new messages