10se1ucgo / cue_sdk

Python wrapper for the Corsair Utility Engine SDK
Other
21 stars 2 forks source link

WindowsError: [Error 193] %1 is not a valid Win32 application #7

Closed HactarCE closed 7 years ago

HactarCE commented 7 years ago

I encountered this when trying to run the color_pulse example, and when manually typing the commands from the tutorials. I'm running Python 2.7 on Windows 10 64-bit.

Traceback (most recent call last):
  File "C:\Users\USERNAME\Desktop\color_pulse.py", line 66, in <module>
    cue = CUESDK("C:\\Users\\USERNAME\\Desktop\\CUESDK\\bin\\x64\\CUESDK.x64_2013.dll")
  File "C:\Python27\lib\site-packages\cue_sdk\api.py", line 36, in __init__
    self._libcue = CDLL(dll_path)
  File "C:\Python27\lib\ctypes\__init__.py", line 362, in __init__
    self._handle = _dlopen(self._name, mode)
WindowsError: [Error 193] %1 is not a valid Win32 application

Other than the single line cue = CUESDK(" ... ") I did not modify the file at all.

10se1ucgo commented 7 years ago

It seems that you're using a 32-bit version of Python on a 64-bit version of the DLL. Try using the 32-bit version of the DLL or get a 64-bit installation of Python.

You can check the architecture by running this code in the interpreter:

>>> import platform
>>> platform.architecture()
# Outputs this on 64-bit
('64bit', 'WindowsPE')
# This on 32-bit
('32bit', 'WindowsPE')
HactarCE commented 7 years ago

Thanks! Using the 32-bit DLL worked.