Re:Pex: A tool for generating .pex (Python EXecutable) files...
by Esgrove on Friday November 15, 2024 @02:18PM
(#42149940)
There is: PyInstaller
[ Parent
| on HN ]
Re:Pex: A tool for generating .pex (Python EXecutable) files...
by glass-z13 on Friday November 15, 2024 @02:23PM
(#42149978)
Seems like i have it in my browsing history, i remember not being able to run the executable it produced, not being able to find a library it was supposed to have. This was just using the default "pyinstaller your_program.py", and i was frustrated enough to not go deeper into why that was. Will definitely give it a try again in the future
Re:Pex: A tool for generating .pex (Python EXecutable) files...
by WhyCause on Friday November 15, 2024 @04:19PM
(#42151217)
PyInstaller-made executables also used to have a habit of getting flagged by security software as malicious (maybe that's why you couldn't run it?) -- apparently, so many malware writers used it that it ruined the party for everyone.
Fortunately, that was only the 32-bit version of Python 2.7. Using 64-bit versions or Python 3 was enough to not get flagged as malicious. I figured that out when I decided I didn't want to teach myself Go just then to deploy something that had worked the day before.
Re:Pex: A tool for generating .pex (Python EXecutable) files...
by randlet on Friday November 15, 2024 @03:06PM
(#42150380)
Pyinstaller can be a bit fiddly to get right initially if you have a lot of package dependencies, but other than that it works really well.
Re:Pex: A tool for generating .pex (Python EXecutable) files...
by Numerlor on Friday November 15, 2024 @05:54PM
(#42152209)
Using the spec files for persistent readable configuration also goes a long way, if you treat pyinstaller as a python module you can automate it whole with just python, including the spec files as it executes them as python scripts
I've had automated builds running mostly untouched for years here https://github.com/Numerlor/Auto_Neutron/blob/master/pyinsta..., though it doesn't have any particularly troublesome packages other than PySide6
Re:Pex: A tool for generating .pex (Python EXecutable) files...
by ktm5j on Friday November 15, 2024 @03:53PM
(#42150888)
Yep I used it at my last job and it worked great! Startup times were horrible, but that didn't matter so much to us and it solved tons of problems we had with people messing up their python environments. Takes some tweaking to get certain modules (like scikit-rf) to work, but never found an issue that couldn't be solved.
Would recommend!