arvindh arvindh - 1 month ago 12
Python Question

Can i use Docker for creating exe using pyinstaller

I am supposed to create an executable for windows, mac and linux. However, I don't have a windows machine for time being and also I don't have a mac at all. I do have a Linux machine but I don't want to change the partition or even create a dual boot with windows.

I have created an application using python and am making my executable using pyinstaller. If I make use of Docker (install images of windows and mac on linux), will I be able to create executable for windows and mac with all dependencies (like all

.dll
for windows and if any similar for mac)?

Answer

I don't think so. Your docker container container will be a Linux system. If you run it, when ever you are on windows/mac/linux, it is still running on a linux environement so you it will not be a windows or mac compatible binary. I don't know well of python. But if you can't make windows binary from linux, you will not be able to do so in a container.