PyInstaller and Drag and Drop
KevinDuggan opened this issue · comments
Bug Report
Exception: External Drag'n Drop not available on this platform
[11423] Failed to execute script draganddrop
Context
used PyInstaller to create single file. On running app on OSX get the above error report. Works fine in PyCharm on OS X 10.14.6
Expected Behaviour
No error message and same behaviour as when running under PyCharm
Actual Behaviour
Cannot run app.
Any error messages produced by appJar
Traceback (most recent call last):
File "draganddrop.py", line 13, in
app.setLabelDropTarget("dropLab", externalDrop)
File "", line 1, in setLabelDropTarget
File "appJar/appjar.py", line 2991, in configureWidgets
self.configureWidget(kind, names, option, value)
File "appJar/appjar.py", line 3185, in configureWidget
self._registerExternalDropTarget(name, item, value[0], value[1])
File "appJar/appjar.py", line 1159, in _registerExternalDropTarget
raise Exception("External Drag'n Drop not available on this platform")
Exception: External Drag'n Drop not available on this platform
[11423] Failed to execute script draganddrop
Sample code, demonstrating the issue
from appJar import gui
def externalDrop(data):
print("Data dropped:", data)
app = gui("External dnd Demo")
app.setFont(20)
app.setBg("SlateGrey")
app.setFg("yellow")
app.addLabel("dropLab", "Drop Here")
app.setLabelDropTarget("dropLab", externalDrop)
app.go()
compiled with Pyinstaller
python3 /usr/local/bin/pyinstaller --onefile --clean --add-binary='/System/Library/Frameworks/Tk.framework/Tk':'tk' --add-binary='/System/Library/Frameworks/Tcl.framework/Tcl':'tcl' /Users/kevin/Desktop/Code\ GUi/draganddrop.py
Version Information
PyInstaller 3.5
Just to confirm - drag & drop is working on your Mac, but not when pyinstaller is used to make a package.
To be honest, I've never tested drag & drop with pyinstaller, and have had difficulties in the past on Mac to get it to work, due to missing libraries, etc...
Does it work without drag & drop, so if you just create a simple GUI?
same error on linux
same error on windows as well
same error on windows as well²