I want my python GUI apps to run on all three OSs without need to recompile on each platform. Is python executable created by pyinstaller (by or similar utility) platform independent like Java's bytecode? Java's bytecode runs on Windows, Mac and Linux using JRE.
1 Answer
It's right there in the documentation
The output of PyInstaller is specific to the active operating system and the active version of Python. This means that to prepare a distribution for:
- a different OS
- a different version of Python
- a 32-bit or 64-bit OS
you run PyInstaller on that OS, under that version of Python. The Python interpreter that executes PyInstaller is part of the bundle, and it is specific to the OS and the word size.
In other words: no, it's not portable. You need to compile for each platform/architecture.
As stated by @juanpa.arrivillaga in the comments, this has nothing to do with the bytecode python normally executes. That is portable. The problem here is that PyInstaller bundles a python interpreter that is os- and architecture- specific (that is, this doesn't work for the same reason you wouldn't normally be able to run a Windows executable on MacOs).
[java]. You are not actually asking anything about Java, and your Q&A won't help someone asking about Java topics.