I'm trying to compile my Python project to a Windows executable (.exe) using Nuitka. I get no errors/warnings during the compilation process, but when I'm trying to run the resulting executable I get the "C:\Python34\test.exe is not a valid win32 application" error on Windows XP and a similar one on Windows 10, too). The problem persists even when I compile a "Hello, World!" program. Interesting, that I can easily build and run C++ projects from the Visual Studio IDE on the same PC.
I'm using Windows XP (x32 bits), Python 3.4.0 and Microsoft Visual C++ 2008 Professional.
How can I solve this problem?
I used tried the first steps from the Nuitka website and had the same with example 1. What I found: example 1 uses --mingw64 as option.
python -m nuitka --mingw64 hello.py
In example 2/Use Case 1 there is another option introduced:
python -m nuitka --follow-imports program.py
I only copied my hello-code from example 1 (working) and renamed it to program.py (failed - even no executable!). So I am shure, the cause will be the call and not the code.
When I entered --mingw64 to the second call it worked.
My first thought (I am new to this and no expert for nuitka) is that the second example call implicitly uses gcc. At the first time it asks for installing it and then it seems to use it. The first call seems to force mingw64 as compiler. Could also be that the sequence of path entries makes a difference. Just the first entry will be executed unless you force it via an explicit option.
After compilation of any Python program with Nuitka I get "is not a valid win32 application" error