Create python executables (portability)

Asked

Viewed 334 times

2

I have python code developed on macos system. It is possible to generate executables to run on other systems (windows, linux)?

Example:

the file file.py was written and tested on macOS system, but I want to generate an executable to run on windows: file.exe from the Macintosh system. (vice versa)

QUESTION:

How to accomplish this task knowing that I do not have windows system on machine, and the goal is to create a .exe in Macos ?

I already know the Py2Exe, Py2App and the cx_Freeze (among others), but they do not solve the problem, since it would need the windows system to generate the .exe

I hope I wasn’t confused!

  • What you seek is a cross-compilation (compile on the X platform generating an executable for the Y environment). I can’t tell you if there are cross-compilers from Mac pro Windows, but I suggest starting your search around (unless someone suggests something more directly in a reply).

  • P.S. Veja that question on Soen. It refers to the cross-build of Linux pro Windows, but since Mac OSX is also POSIX, it might work for you.

1 answer

1

Hello!

Well, to generate an executable . exe, you will need to have a windows operating system, that I know there is no way.

But, one thing you can do is install a Windows virtual machine or use Bootcamp, a software (not tested) that installs along with your Windows Mac (click here to the site of a tutorial of it). But of course, only do this if the need for a windows executable is very large same.

Hug!

Browser other questions tagged

You are not signed in. Login or sign up in order to post.