Pyinstaller, how to make 32bit and 64bit .exe on 32bit linux? - windows-7

I created executable using pyinstaller 2.0 and python2.7 on ubuntu 12.04 32bit (so I assume python is also 32bit).
It's a simple program in console (no gui), that connects to TCP/IP server and send frames.
It works under my ubuntu 32bit, but it does not run on Windows 7 32bit and 64bit.
On Win32bit it returns error "Device is not ready", and on Win64bit it returns error that "application has wrong architecture".
Where can be cause of this?
Here is a link to whole app code (it's small) http://pastebin.com/qj96vpgK

The Linux version of PyInstaller can not make .exes or any non-Linux-native format. In order to make a Windows executable, you need to either use WINE (or at least they say, but I'm not sure how to do that), or use a Windows computer.
Additionally, if the Windows computer you use is 32-bit, it can not make 64-bit binaries. If you have a 64-bit install of Windows, it can make 64-bit binaries easily, but in order to make 32-bit ones, you need to install a 32-bit version of Python (and all the required libraries for your program).
Thus, one way to make both 32- and 64-bit executables for a given program, copy your code over to a Windows 64-bit OS, install the 32 and 64-bit Python and pywin32, and use PyInstaller using each different Python.

Related

Getting the error: bash: (program): cannot execute binary file: Exec format error, on both 32-bit and 64-bit Windows

There is a program developed for linguistic research (http://people.csail.mit.edu/mcollins/code.html). When I try to run the parser using Git bash terminal on Windows, I get the error:
bash: cannot execute binary file: Exec format error.
First, I assumed it's because of my 64-bit OS, since the file is 32-bit. So, I tried the program on a 32-bit system, but got the same message.
Any ideas on how to fix the issue?:
file (program) shows:
ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux.so.2, for GNU/Linux 2.2.5, with debug_info, not stripped
uname -srv for my 64-bit OS, shows:
MINGW64_NT-10.0-19042 3.1.7-340.x86_64 2021-03-26 22:17 UTC
uname -srv for my 32-bit OS, shows:
MINGW32_NT-6.1-7601 3.1.7-340.i686 2021-03-26 22:01 UTC
P.S.: If you'd like to give it a try, this code should work in the program directory, but it doesn't work for me:
gunzip -c models/model2/events.gz | code/parser examples/sec23.tagged models/model2/grammar 10000 1 1 1 1 > examples/sec23.model2
As indicated by file, your program is a Linux application so you can't run it on Windows. See
Why does a linux compiled program not work on Windows
Why won't Windows EXE files work on Linux?
Why do you need to recompile C/C++ for each OS?
Mingw is not an environment for running Linux executables, it's just a compiler that compiles POSIX code into native Windows binaries. Neither is Cygwin, which is a reimplementation of POSIX system calls in Windows, and Cygwin binaries are also native Windows binaries with a dependency on Cygwin DLLs. Read this if you want to know their differences. Bash is a shell and isn't a platform to execute files either. Only the runtime platform (OS or something like JVM or .NET CLR VM) can run programs and a shell is just a tool to interact with the OS
So you must run Linux programs in a Linux environment like a Linux machine or WSL1/2. Since the program is 32-bit, you can only run it in Linux or WSL2
Since you have the source code you can also compile the code with mingw or cygwin and run on Windows
Thanks to the answer provided by #phuclv, I realized I need to run the program in Linux. So, I installed 32-bit Linux (I used Linux Mint Debian Edition) on a virtual machine (VirtualBox) on my 64-bit Windows 10, and it worked!

Is it possible to get autotools for a 64bit Windows 10

I am trying to build an old program and have to do it on windows. In the build instructions i am required to use autoreconf and therefore i need to have autotools.
I have tried searching for it for a while and installing cygwin or gnuWin32 but I have come to a conclusion that those bins only work for a 32 bit operating system.Is there any way I can get those binaries for a 64 bit system?

Python 3.5 64bit on Windows 8.1 64bit, The only way to install TensorFlow binaries on Windows does not work

Is it possible to install Python 3.5.x on Windows 8.1?
The primary goal is to install TensorFlow directly on my Windows.
It is not working. More specifically when using a 64 bit windows, and naturally trying the 64bits Python. The AMD name in the installation file is confusing, since my laptop is an Intel. But that is the only 64 bit option so I select that.
I try to set up via binaries. In the middle of installation a GUI tells me installation failed:
BTW, I have done my best to remove any remaining Python 32 bits from my system.
Gooogling "python supported windows versions" brings up Using Python on Windows — Python 3.5.3 documentation1:
3.1.1. Supported Versions
As specified in PEP 11, a Python release only supports a Windows
platform while Microsoft considers the platform under extended
support. This means that Python 3.5 supports Windows Vista and newer.
If you require Windows XP support then please install Python 3.4.
1Or rather, https://docs.python.org/3/using/windows.html from which you can switch to the 3.5's version of the article with the drop-down list in the upper-left corner
After running windows update, I finally managed to install python 3.5 64 bits and then tensorflow on my windows 8.1.

What is an "X11 platform" and can it run on windows?

I'm trying to get GtkPlug and GtkSocket to work on Windows 8, using the currently supported GTK3+ windows bundle.
I see in the documentation this note:
The GtkPlug and GtkSocket widgets are only available when GTK+ is
compiled for the X11 platform and GDK_WINDOWING_X11 is defined. They
can only be used on a GdkX11Display. To use GtkPlug and GtkSocket, you
need to include the gtk/gtkx.h header.
What is an X11 platform, and can it be run on windows?
X11 is the graphics platform used by Linux and other Unix-style OSes. It is available for Windows through the Cygwin package but binaries compiled under Cygwin will not run on Windows without Cygwin installed so you probably don't want to go down that path. The documentation is essentially saying "this feature is only available on Linux."

How can I package my perl script as a 32-bit executable?

I'm on 64-bit Windows 7 machine, and I've been using PAR:Packager to package my scripts as .exe's.
However, I now need to run these .exe's on a 32-bit Windows 7 machine.
Is there anyway to package it as a 32-bit executable from a 64-bit machine? (is it possible with PAR:Packager?)
You could install a 32-bit perl on your 64-bit machine, but most folks will recommend you just keep a 32-bit VM laying about for those times you need to publish software for legacy machines.

Resources