How to make Linux executable file on Windows using PyInstaller?

Viewed 1177

I have made a PyQt5 app in Python. This app supports both Windows and Linux. Now the problem is, I want to Compile this Python app to Windows and Linux Executable. I can create Windows executable file from my windows PC. But to Create a Linux Executable I need to move to Linux. I use Kali Linux Live version. and to boot into Linux, It takes sometimes. But I want to make Linux executable from Windows using pyinstaller.

1 Answers

You can't. You need to compile it on a linux system and it's most likely not backwards compatible. It is recommended that you use a VM.

From the documentation:

If you need to distribute your application for more than one OS, for example both Windows and Mac OS X, you must install PyInstaller on each platform and bundle your app separately on each.

You can do this from a single machine using virtualization. The free virtualBox or the paid VMWare and Parallels allow you to run another complete operating system as a “guest”. You set up a virtual machine for each “guest” OS. In it you install Python, the support packages your application needs, and PyInstaller.

Related