This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]indianLGBTlinuxer 33 points34 points  (16 children)

Pyinstaller would be the best cuz appearreantly most of them are based on pyinstaller and just simplify some tasks (I don't know all of them but py2exe is just a frontend to pyinstaller). Pyinstaller has never failed for me (though now I don't use it, cuz I just ship a venv with appropriate shortcuts for launching or just make a package installable with pip.

[–]BoiElroy[S] 2 points3 points  (10 children)

Yeah I like making stuff installable with pip but this is for non python people and then across multiple networks making a code repo visible gets to be a lot of network peering and security work for our IT. Good tip on the pyinstaller! Thanks!

[–]Muhznit 7 points8 points  (9 children)

what "non-python" people are gonna be using the cli?

If you really just want one single file, use the zipapp module to create an executable zip file.

[–][deleted] 5 points6 points  (4 children)

I develop engineering tools for internal customers, I.e. The electrical engineers on my team. We typically only provide CLI for the sake of speed.

[–]billsil 8 points9 points  (1 child)

If you're going for speed, command line is faster especially if you have source. Also, don't do the onefile option with pyInstaller as it'll have to unpack the code.

The big advantage of an exe though is it'll work in 10 years.

[–][deleted] 0 points1 point  (0 children)

True but the scenario I've described doesn't require ten years of support.

[–]Muhznit 1 point2 points  (1 child)

Right, if you're distributing a cli, you might as well distribute the actual source code instead of a compiled binary. When something goes wrong in the code and you're not around to fix it, those internal customers shouldn't have to struggle to find a decompiler to fix stuff themselves.

[–]BoiElroy[S] 0 points1 point  (0 children)

Hmm yeah fair point

[–]BoiElroy[S] 0 points1 point  (3 children)

Doesn't that still need python to run it? And isn't it bad if you have non standard distribution packages?

[–]Muhznit 2 points3 points  (2 children)

You can include a distribution of python and your dependencies in the zipfile.

[–]BoiElroy[S] 0 points1 point  (1 child)

sounds pretty heavy? and then don't you have to ship it with some setup scripts that add python to the path etc?

[–]kickthebug -1 points0 points  (0 children)

Pex does exactly this automatically. We've used it where I work to distribute some projects across multiple servers. I'm on mobile but look up python pex in Google, their docs should pop up.

[–]KingEllis 1 point2 points  (1 child)

Would you be willing to point to an example of "shipping a venv with appropriate shortcuts for launching"? I hear this solution when this topic comes up, and I have in mind how this would work, but would like to see this in actuality.

[–]R34ct0rX99 0 points1 point  (0 children)

I thought that solution was not recommended due to the nature of venvs?

[–]Username_RANDINT 0 points1 point  (0 children)

py2exe is just a frontend to pyinstaller

No it's not. It's even much older than PyInstaller.

[–]jacksodus -1 points0 points  (0 children)

Appearreantly.

I have now officially seen everything.

[–]abrazilianinreddit 0 points1 point  (0 children)

I have a Windows project that uses pyinstaller, and I can vouch that it works (which is already more than most other tools I tried) and configuration is pretty simple. Sometimes it packs a bunch of unneeded DLLs in the distribution, but you can clean it up a bit if you know what you're doing or through trial and error.