I'm using a 64-bit version of python, on a 64-bit version of Windows 10, to run some code. However, the code fails on importing ctypes. In fact, the minimum example for the problem is simply:
import ctypes
Which fails here:
from _ctypes import Union, Structure, Array
With this error:
DLL load failed: %1 is not a valid Win32 application
Reading around, this seems to be an issue with loading a 32-bit dll into a 64-bit version of python (or vice-versa, but my version of python is 64-bit, so...). However, what I don't understand is that ctypes seems to be something that is bundled with python, i.e. it was installed when I installed python. Is ctypes itself in the wrong architecture? How is that possible if it came with the 64-bit version of Python?