0

I've tried PyInstaller, but it doesn't support Python 3.7. I'm using Python 3.7 features, so I don't want to downgrade to 3.6. How can I make my program a single-file, cross-platform executable?

Peter Mortensen
  • 30,030
  • 21
  • 100
  • 124
kdgeiger
  • 9
  • 1

2 Answers2

0

Have you tried to use cx_Freeze? For Python 3.7, you need to apply the bugfix described in this answer by hand to your local cx_Freeze installation until a corrected version has been released.

cx_Freeze itself does not support building a single-file executable, but you can use further tools for this purpose as described here.

jpeg
  • 2,192
  • 3
  • 17
  • 28
0

This depends on what you mean by "EXE file".

If you can jam all your source code into a single.py file then that would likely be the closest to a cross platform executable. It would just require having a python interpreter pre-installed on each OS.

If you are referring to a literal .exe executable file that works cross platform; for python programs this is impossible. Python compiles down to machine code in the same way that C and C++ do, which is platform specific. Unlike Java, which runs on a VM, if you wish to compile your python program into a single executable file, then the file will only work on whatever platform it was compiled on.

alexpdev
  • 2,395
  • 2
  • 6
  • 20