3 ms·
What's the solution for shipping a desktop Python app these days? I use Python a lot for small internal tools and always land up having to ship it as part of a
by simonbarker87 3y ago
What's the solution for shipping a desktop Python app these days? I use Python a lot for small internal tools and always land up having to ship it as part of a web service and build a web UI for it so staff can use it as "set up conda, install the deps and run python ... " doesn't fly
- noncovalence 3y agoThere's a few projects that can package a python environment into a single executable (the main tradeoff is you end up including a copy of python with every single executable if you have lots of tools) - when I wanted it to create an installer (.msi/.dmg), I've found cx_Freeze came the closest to "it just works".
- longqzh 3y agoPyinstaller just works.
- quietbritishjim 3y agoIt secretly extracts its internal Python files to a temp directory and runs them from there, which can look a bit virus-ish and can potentially leave them lying around forever if the application doesn't exit cleanly.
- quietbritishjim 3y agoI find Nuitka worked a lot better than the alternatives. It genuinely compiles the Python to an executable, rather the all the other alternatives (like pyinstaller) which actually have the Python files hidden inside of them. It doesn't give any particular speed advantage (despite that being the original point) but works very well for packaging. I would suggest using the "standalone" mode of Nuitka. As the name suggests, it is self contained, but it's a lot of files per program because all the C extension modules are separate files. It's tempting to use "onefile" model instead because it really is over for so seems neater, but this is really just a self extracting program with the same files hidden inside as standalone, so has a few issues like the other packagers (e.g. can trigger virus warnings or leave files lying around in temp directory).
- __d 3y agoI've had good experience with PyInstaller across macOS, Windows, and Linux. I've mostly used PyQt5, and it's able to package that without any extra effort. I use the "package it all into one file" option: it's a little slow to start, but for my purposes (primarily, longer-running applications) that's ok.