Pyinstaller, how to make 32bit and 64bit.exe on 32-bit Linux?

I created an executable using pyinstaller 2.0 and python2.7 on ubuntu 12.04 32bit (so I assume python is also 32 bit).

This is a simple console program (without gui) that connects to a TCP / IP server and transfers frames. It works under my ubuntu 32bit, but it does not work on Windows 7 32bit and 64bit. On Win32bit, the error "Device is not ready" is returned, and on Win64bit it returns the error, "the application has the wrong architecture."

Where could this be the reason?

Here is a link to the entire application code (it's small) http://pastebin.com/qj96vpgK

+4
source share
1 answer

So, I struggled with this problem all the time, and I thought that I would publish my conclusions.

The Linux version of PyInstaller cannot make .exe or any non-Linux-native format. To make a Windows executable, you need to either use WINE (or at least say you don’t know how to do this) or use a Windows computer.

In addition, if the Windows computer you are using is 32-bit, it cannot execute 64-bit binaries. If you have a 64-bit version of Windows installed, it can easily make 64-bit binaries, but to create 32-bit you will need to install the 32-bit version of Python (and all the necessary libraries for your program).

So, to create a simple program to update the LCD with 32-bit and 64-bit binaries, I had to write code, copy it to 64-bit Windows, install 32-bit and 64-bit Python and pywin32 , and use PyInstaller using every other Python.

+2
source

Source: https://habr.com/ru/post/1436334/


All Articles