Я установил tkinterdnd2 с помощью pip install tkinterdnd2.
Не уверен, что это необходимо, но вот каталог программы: (png используются только для моей программы, не думаю, что это виновато):
Код: Выделить всё
Folder
- cardiologist.png
- img.png
.
. # a couple more pngs
.
- main.py
- patients' data csv.csv
- patients' data xlsx test.xlsx
- sample.xlsx
- sun-valley.tcl #this file and the 'theme' folder below are for my program's theme, also don't think these are the culprit
- theme
- dark
- a lot of pngs...
- dark.tcl
- light
- a lot of pngs...
- light.tcl
Код: Выделить всё
build
- main
- base_library.zip
- certifi
- IPython
- jedi
- (some other files)
.
. a lot of .dylib files
.
- main # exe file to execute to run program
- matplotlib (this and next 4 are folders)
- numpy
- pandas
- parso
- PIL
- Python # exe file, don't know what this was created for
- (some more folders)
- tcl (this and next 2 are folders)
- tcl8
- 8.4
- platform
- .tm file
- .tm file
- 8.5
- 2 .tm files
- 8.6
- .tm file
- tdbc
- .tm file
- tkdnd2.8 (tried renaming to just tkdnd but same error)
- tk
- ttkwidgets
- 2 other folders
Код: Выделить всё
python -m PyInstaller main.py. # without python -m, 'command not found error' would happenКод: Выделить всё
Traceback (most recent call last):
File "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 "main.py", line 16, in
File "tkinterdnd2/TkinterDnD.py", line 285, in __init__
File "tkinterdnd2/TkinterDnD.py", line 55, in _require
RuntimeError: Unable to load tkdnd library.
[7015] Failed to execute script 'main' due to unhandled exception!
logout
Saving session...
...copying shared history...
...saving history...truncating history files...
...completed.
Я также пытался использовать для упаковки другие модули, такие как cx_freeze и py2app, но оба выдали разные ошибка, поэтому я вернулся к pyinstaller на данный момент. Я использую macOS.
Как исправить эту ошибку?
ИЗМЕНИТЬ
также пробовал python -m PyInstaller --clean -y -n "output_name" --add-data="tkdnd:tkdnd" main.py, но при запуске возникла та же ошибка.>
Подробнее здесь: https://stackoverflow.com/questions/689 ... this-error
Мобильная версия