title: Python Ctypes - loading dll throws OSError: [WinError 193] %1 is not a valid Win32 application
body: <p>I have tried to run an exemple of a python code that gets a function from a library  using ctypes. The exemple can be found <a href="https://github.com/dvida/py-ctypes-multidimensional-arrays" rel="noreferrer">here</a>. I followed the instruction and beside one minor modification, I have used the exact same code. I have been trying to run this on Windows 10 (64-bit), python 3.7 (64-bit) but got this error message:</p>
  
  <pre><code>Traceback (most recent call last):
    File "C:/Users/gifr9302/PycharmProjects/testpytoc/myfunc.py", line 128, in &lt;module&gt;
      libmyfunc = npct.load_library('myfunc.dll', os.path.dirname(os.path.abspath(__file__)))
    File "C:\Users\gifr9302\AppData\Local\Programs\Python\Python37\lib\site-packages\numpy\ctypeslib.py", line 152, in load_library
      return ctypes.cdll[libpath]
    File "C:\Users\gifr9302\AppData\Local\Programs\Python\Python37\lib\ctypes\__init__.py", line 431, in __getitem__
      return getattr(self, name)
    File "C:\Users\gifr9302\AppData\Local\Programs\Python\Python37\lib\ctypes\__init__.py", line 426, in __getattr__
      dll = self._dlltype(name)
    File "C:\Users\gifr9302\AppData\Local\Programs\Python\Python37\lib\ctypes\__init__.py", line 356, in __init__
      self._handle = _dlopen(self._name, mode)
  OSError: [WinError 193] %1 n’est pas une application Win32 valide
  </code></pre>
  
  <p>translated:</p>
  
  <p><code><strong>OSError: [WinError 193] %1 is not a valid Win32 application</strong></code></p>
  
  <p>I have tried to create a dll instead of a so file and still got the same error. It would seem it tries to run a 32-bit application on a 64-bit system but I'm not sure why. Can anyone help?</p>