7

I used Pyinstaller to make a standalone portable application for windows from python code, and it works normally.

I understand that to create an executable for a certain OS it must be done on that specific OS.

Is there a way to create executables for other platforms directly from windows without running a virtual machine.

Thank you.

1
  • Welcome to Stack Overflow. Don't forget to accept an answer (tick the check-mark next to an answer) if it answers your question. In this way your question stops from showing up as unanswered. Also up-vote good answers. – As you're starting out here, please take the tour, read about what's on-topic, and have a look at How to Ask a Good Question. Commented Aug 4, 2020 at 12:54

4 Answers 4

3

Since pyinstaller is not a cross-compiler (which means with pyinstaller you cannot create an executable for any other system than the one you are on), you will have to look for other tools.

On the official github FAQ, they recommend using Wine for this specific purpose.

Link to FAQ.

Since you don't want to look for other systems to compile your code on, this seems to be the only option.

Sign up to request clarification or add additional context in comments.

1 Comment

Would docker be a solution? Not sure if it can work between Mac and Linux as they are "Unix-based" and their kernels are more similar that Windows's.
1

if you have docker-expertise, you could try to get the docker-containers in the following link to do the job for you (creating the executable for windows/linux by setting up a docker-container for each target-system) and starting up the Docker-Containers for Building the Executables from within your Windows-OS. I have not tryed it out though, but the Readme of the project sounds promising.

https://github.com/cdrx/docker-pyinstaller

If the project does what it says, you would only need to execute the following two commands in your project-folder to create the executables for Windows and Linux, when you have gotten everything setted up:

docker run -v "$(pwd):/src/" cdrx/pyinstaller-windows

docker run -v "$(pwd):/src/" cdrx/pyinstaller-linux

1 Comment

Wouldn't docker reuse the kernel of the host OS? Windows kernel is entirely different from Linux / MacOS I believe
0

In order to make executable files for Mac and Linux, you need to build it on the same systems For example, in order to make your Linux work, you need to collect the rpm package

Comments

0

No, pyinstaller isn't a cross-compiler, so just use VM.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.