by privacyonsec on 12/4/21, 6:28 AM with 89 comments
by pansa2 on 12/4/21, 10:01 AM
Unfortunately high-quality bundling into executables just isn’t a focus of Python (nor of any other high-level language). Personally, I’ve gone back to C++ for building command-line apps - as a developer I’d much rather be writing Python, but that’s no good if I can’t actually deliver software to users.
by ZuLuuuuuu on 12/4/21, 11:03 AM
And we are mostly developing internal tools, so the executable size isn't a huge concern. But we still want an executable that can be copied from computer to computer and can be opened via a simple double-click, because not everybody in our company is a software engineer, a lot of people are just used to copying the executable to their computer and double-clicking on it to launch it. We don't use the --onefile feature since it makes the launches slow because of the extraction step. So we have a folder with an executable and the dependencies in it.
PyInstaller was a very good fit for our case. Yes the size of the bundle is quite big but it does the job. And allowed us to keep our whole code base in Python.
by quietbritishjim on 12/4/21, 8:40 AM
Despite the title, pyinstaller doesn't really compile anything, it just bundles your bytecode and the interpreter into a binary. That's often useful, but it's not the same thing. You can get similar-ish results to Nuitka by combining pyinstaller with Cython but it's quite a bit of work.
by welder on 12/4/21, 4:42 PM
Using Go solved so many long-tail bugs for us and just simplified the whole process of shipping code to user machines.
Here's the old but working build script that built both PyInstaller and Nuitka [3].
[1] https://github.com/wakatime/legacy-python-cli/tree/standalon...
[2] https://github.com/wakatime/wakatime-cli
[3] https://github.com/wakatime/legacy-python-cli/blob/standalon...
by pacifika on 12/4/21, 8:44 AM
It’s the main reason I’m looking at switching to Go for these kinds of apps. Python should have a working solution as part of the standard library.
by kissgyorgy on 12/4/21, 9:01 AM
It's written in rust and can embed resources and dependencies in the executable.
by anakaine on 12/4/21, 11:04 AM
by jacksonkmarley on 12/4/21, 9:55 AM
However I eventually abandoned hope that I was on a fruitful path, and changed course for web server land, embarking on the python web framework selection dance.
by ashishknitcs on 12/4/21, 2:09 PM
I’m from a IT dept of a oil company not much of savvy apps mostly dull.
As manager have to do lots of data wrangling for this and that form of reports.
scripts to do jobs on machine.
Python is only fullstack i know. Pyinstaller is mine goto tool to build executable and make it portable across environment.
by ta988 on 12/4/21, 3:54 PM
by remram on 12/4/21, 2:45 PM
[1]: https://github.com/hankhank10/false-positive-malware-reporti...
by zvr on 12/9/21, 3:27 PM
One issue with PyInstaller is that, by default, it includes all dynamic libraries that the Python interpreter has on your machine. It makes sense, it needs an interpreter and collects what is needed for it to run.
Unfortunately this might include libreadline.so, which is licensed under GPL, making your resulting executable unable to be distributed under a proprietary license.
There are ways to solve this issue, but one has to search and read documentation (and code, in my case -- when I was researching it, the docs were not clear).
by mark_l_watson on 12/4/21, 1:35 PM
I tried pyinstaller a few years ago, but it does not support some 3rd party libraries like TensorFlow that I frequently use. That said, I like that they clearly list supported 3rd party libraries so it is a quick check if pyinstaller will work for a specific project.
by Fizzadar on 12/4/21, 12:40 PM
Still, I am a huge fan of the project and it makes it possible to make webview desktop “apps” (like or hate them) with Python.
by groundthrower on 12/4/21, 7:48 PM
by scarygliders on 12/4/21, 2:15 PM
Your app will start quicker, because it won't be a case of the "single executable" doing the old unzip-and-run thing every time.
by fxtentacle on 12/4/21, 5:15 PM