Windows Python 3.12.7 64-bit (AMD64) fails to run on on Windows 11 ARM
Bug report
Bug description:
Installing (AMD) 64-bit Python on Windows 11 ARM is not a problem, however on running python.exe this dialog pops up:
python.exe - Bad Image
C:\Users\Brecht Machiels\AppData\Local\Programs\Python\Python312\VCRUNTIME140.dll is either not designed to run on Windows or it contains an error. Try installing the program again using the original installation media or contact your system administrator or the software vendor for support. Error status 0xc000007b.
OK
Running py -V:3.12 returns no output, but exists with a 127 return code.
Renaming vcruntime140.dll and vcruntime140_1.dll that sit alongside python.exe fixes the issue.
The 32-bit version of Python 3.12.7 does not suffer from this issue.
For completeness: I'm running Windows 11 ARM on an M1 MacBook using UTM.
CPython versions tested on:
3.12
Operating systems tested on:
Windows
Interesting. Could you open the Properties page of that vcruntime140.dll and screenshot the General and Details pages for me?
These are from https://www.python.org/ftp/python/3.12.7/python-3.12.7-amd64.exe
BTW, only vcruntime140.dll needs to be moved/renamed. vcruntime140_1.dll can be left alone.
Thanks. Those sure seem like the right files.
Do you have any other versions of Python installed? And did you install this Python (and any others) onto PATH? The error looks most like a corrupt/confused PATH variable, like you've got an ARM64 native Python that is being launched but the AMD64 one is earlier on PATH or the ARM64 DLLs are not being used.
I have these installed (py --list output):
-V:3.13-arm64 * Python 3.13 (ARM64)
-V:3.12 Python 3.12 (64-bit)
-V:3.12-32 Python 3.12 (32-bit)
None of these are in PATH. The error dialog pops up (twice!) when I run the amd64 python.exe by double-clicking it in Windows Explorer or running it from cmd.exe. When running it from PowerShell, there is no output:
PS C:\Users\Brecht Machiels\Code> & "C:\Users\Brecht Machiels\AppData\Local\Programs\Python\Python312\python.exe"
PS C:\Users\Brecht Machiels\Code> $LastExitCode
-1073741701
It doesn't trivially reproduce on a clean ARM64 machine, so I think we're still looking for something unique to your setup.
Could you share your entire PATH variable? Or if there's nothing of interest there, the next thing I'll be interested in is the full path of every vcruntime140.dll on your system and their sizes, or alternatively a Process Monitor trace to see exactly which file Python is trying to load.