Hey everyone! I know that creating a .exe application from Python is pretty straightforward on Windows, but I'm wondering what the best approach is for generating executable files on Linux and MacOS without needing virtual environments. I don't have a UI for my application; it's strictly command-line based. Is there a more environmentally-friendly way to package it? Thanks in advance for your advice!
4 Answers
If you're looking for a tool to bundle your Python app, definitely check out PyInstaller! It can create executables for different platforms, but you'll have to run it on each specific OS. So, for Linux, you'll need access to a Linux machine or VM to do the packaging.
You can use Nuitka to create executables for different platforms as well. It's pretty powerful and can help you compile directly on the target OS. Alternatively, you might want your users to simply set up 'uv' for your project. It can manage the Python interpreter and dependencies, making it easier for them to run your script with just one command!
That's a great tip! I'll look into that.
You've got a good question here! Just remember that .exe files are specific to Windows. To generate executables for other systems, you'll have to set it up on each respective OS. If you're open to exploring options, Github Actions is another great way to build multi-platform executables without needing the physical machines.
Have you thought about Java? Just throwing that out there! I know it’s a bit of a hassle to rewrite your app, but it might save you some headaches down the line.
Haha, as tempting as that sounds, rewriting everything in Java would be a huge pain!

I noticed that it mentions needing to be on the OS to generate the app. Can I set it up to create a Linux version from Windows?