Generate EXE for Windows different Architectures

6

How to compile a Python desktop application for Windows with PyInstaller?

The problem is the difference of architectures, I'm using PyInstaller to generate an EXE from the x64 architecture when executing it in x86 it tells me that there is an error in the architectures and it can not be executed.

The documentation of PyInstaller says that it is not possible to generate the EXE from different Operating Systems, therefore, it is not possible if it is not the same environment.

Does anyone know of any alternative to the solution?

Reinstalling an operating system for each architecture or operating system on each machine installing Python and PyInstaller (where necessary) does not seem a viable option.

    
asked by Sergio Gonzalez 30.03.2016 в 21:03
source

2 answers

1

I have never used PyInstaller before, so I do not know exactly how it works, what I do know is that 64-bit Windows operating systems have the ability to run 32-bit programs, but this does not happen the other way around. I see what you're trying to do.

The solution seems to me to be very simple, it uses a 32-bit system to generate the application, it should run on both your 32-bit and 64-bit systems.

We should thank WOW64 .

    
answered by 30.03.2016 в 21:43
1

PyInstaller generates the .exe using the original Python installation that you have on the host, for example if you have Python 2.7 for 64 bits you can not generate an .exe of 32 since it uses the dll's and dependencies of the Python installation to create the executable.

    
answered by 30.04.2016 в 01:41