Make on Ubuntu a python executable that runs on Mac

Viewed 736

Is there a way to create a python executable on Ubuntu that can also run on Mac?

Note: This executable doesn't have to run on Linux.

1 Answers

You can't!. Please refer to the following link:

https://dzone.com/articles/making-a-stand-alone-executable-from-a-python-scri

There it state:

The format/extension of the executable will depend on which operating system you used for compilation. For example, if you run the PyInstaller command on Windows the executable file will be .exe. If you run it on Linux the extension will depend on the distribution you are using.

A workaround to solve it is:

  1. Run the OS virtually and, create executable in that virtual os and export it later.
  2. WINE works as well! (Though, I didn’t try it myself), refer to the following link https://www.andreafortuna.org/2017/12/27/how-to-cross-compile-a-python-script-into-a-windows-executable-on-linux/
Related