Building a standalone app with pyinstaller. #2530
Replies: 2 comments
-
That error indicates that toga-core is available as code, but for some reason, the package metadata for I don't know what you need to make PyInstaller provide this metadata in a compliant way. It's possible that access to PEP 566 metadata isn't available in a "single executable" app due to the way the app is bundled. This is one of the reasons that BeeWare's packaging solution (Briefcase) doesn't take the "single executable" approach. On macOS, it does produce a single artefact that you can install and trigger with a mouse click, but it doesn't produce a single executable you can invoke from the command line. We're hoping to look at command-line execution in the near future. |
Beta Was this translation helpful? Give feedback.
-
FYI working this here: Looking to add toga to existing app which is already built using PyInstaller. |
Beta Was this translation helpful? Give feedback.
-
I have used pyinstaller for many of my python apps to build into a standalone executable, and
I would like to use it for python Toga apps. When I build with "pyinstaller --onefile myapp.py"
and then run the executable, I get the error,
I'm on MacOs.
I've also tried adding "--hiddenimport=toga-cocoa" or "--hiddenimport=toga_cocoa" to the build,
but still get an un-runnable executable. The app runs fine if it is run as a normal, unbundled python
app, i.e. using "python myapp.py" so the problem is with building the standalone executable version with
pyinstaller. Can anyone see what I've missed, or does anyone have another solution for building
a toga app into a single file executable? Thanks!
Beta Was this translation helpful? Give feedback.
All reactions