Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OSError: [WinError 193] %1 is not a valid Win32 application #2

Open
m3vip2 opened this issue Mar 16, 2019 · 2 comments
Open

OSError: [WinError 193] %1 is not a valid Win32 application #2

m3vip2 opened this issue Mar 16, 2019 · 2 comments

Comments

@m3vip2
Copy link

m3vip2 commented Mar 16, 2019

I got this when running in window mode:

PS C:\Users\est-a\Desktop\bot-master> python spoiler.py
Exception in thread Thread-1:
Traceback (most recent call last):
  File "C:\Users\est-a\AppData\Local\Programs\Python\Python37-32\lib\threading.py", line 917, in _bootstrap_inner
    self.run()
  File "C:\Users\est-a\AppData\Local\Programs\Python\Python37-32\lib\threading.py", line 865, in run
    self._target(*self._args, **self._kwargs)
  File "C:\Users\est-a\Desktop\bot-master\launcher.py", line 66, in start_auto_py
    auto.start()
  File "C:\Users\est-a\Desktop\bot-master\lib\AutoHotPy.py", line 546, in start
    self.interception = InterceptionWrapper()
  File "C:\Users\est-a\Desktop\bot-master\lib\InterceptionWrapper.py", line 171, in __init__
    self.interceptionDll = ctypes.WinDLL ("./lib/interception.dll")
  File "C:\Users\est-a\AppData\Local\Programs\Python\Python37-32\lib\ctypes\__init__.py", line 356, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: [WinError 193] %1 is not a valid Win32 application

no target yet
Exception in thread Thread-2:
Traceback (most recent call last):
  File "C:\Users\est-a\AppData\Local\Programs\Python\Python37-32\lib\threading.py", line 917, in _bootstrap_inner
    self.run()
  File "C:\Users\est-a\AppData\Local\Programs\Python\Python37-32\lib\threading.py", line 865, in run
    self._target(*self._args, **self._kwargs)
  File "C:\Users\est-a\Desktop\bot-master\launcher.py", line 59, in start_bot
    bot.loop(stop_event)
  File "C:\Users\est-a\Desktop\bot-master\character_classes\spoiler.py", line 47, in loop
    if self.set_target():
  File "C:\Users\est-a\Desktop\bot-master\bot.py", line 107, in set_target
    cnts = get_target_centers(img)
  File "C:\Users\est-a\Desktop\bot-master\functions.py", line 125, in get_target_centers
    (_, centers, hierarchy) = cv2.findContours(closed, cv2.RETR_TREE, cv2.CHAIN_APPROX_SIMPLE)
ValueError: not enough values to unpack (expected 3, got 2)

similar in full screen:

Exception in thread Thread-1:
Traceback (most recent call last):
  File "C:\Users\est-a\AppData\Local\Programs\Python\Python37-32\lib\threading.py", line 917, in _bootstrap_inner
    self.run()
  File "C:\Users\est-a\AppData\Local\Programs\Python\Python37-32\lib\threading.py", line 865, in run
    self._target(*self._args, **self._kwargs)
  File "C:\Users\est-a\Desktop\bot-master\launcher.py", line 66, in start_auto_py
    auto.start()
  File "C:\Users\est-a\Desktop\bot-master\lib\AutoHotPy.py", line 546, in start
    self.interception = InterceptionWrapper()
  File "C:\Users\est-a\Desktop\bot-master\lib\InterceptionWrapper.py", line 171, in __init__
    self.interceptionDll = ctypes.WinDLL ("./lib/interception.dll")
  File "C:\Users\est-a\AppData\Local\Programs\Python\Python37-32\lib\ctypes\__init__.py", line 356, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: [WinError 193] %1 is not a valid Win32 application

Exception in thread Thread-2:
Traceback (most recent call last):
  File "C:\Users\est-a\AppData\Local\Programs\Python\Python37-32\lib\threading.py", line 917, in _bootstrap_inner
    self.run()
  File "C:\Users\est-a\AppData\Local\Programs\Python\Python37-32\lib\threading.py", line 865, in run
    self._target(*self._args, **self._kwargs)
  File "C:\Users\est-a\Desktop\bot-master\launcher.py", line 59, in start_bot
    bot.loop(stop_event)
  File "C:\Users\est-a\Desktop\bot-master\character_classes\spoiler.py", line 19, in loop
    targeted_hp = self.get_targeted_hp()
  File "C:\Users\est-a\Desktop\bot-master\bot.py", line 65, in get_targeted_hp
    img_gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
cv2.error: OpenCV(4.0.0) C:\projects\opencv-python\opencv\modules\imgproc\src\color.cpp:181: error: (-215:Assertion failed) !_src.empty() in function 'cv::cvtColor'

I'm using python 3.7.2 32 bit

@m3vip2 m3vip2 changed the title OSError: [WinError 193] %1 no es una aplicación Win32 válida OSError: [WinError 193] %1 is not a valid Win32 application Mar 16, 2019
@UncleInf
Copy link

You are loading wrong type interception.dll - your system, interception .dll and python bit type needs to match - meaning if you have x64 bit windows you need x64 bit interception library dlls and python x64

@rpetersson
Copy link

rpetersson commented Sep 17, 2019

So what do you do if you run Windows 10 64bit? Basicly impossible to install opencv-python for 64bit... Might have gotten a step further but now it throws:

Traceback (most recent call last):
File "_ctypes/callbacks.c", line 315, in 'calling callback function'
File "C:\python projects local\bot-master\lib\InterceptionWrapper.py", line 161, in __interception_is_keyboard
return self.interceptionDll.interception_is_keyboard(device)
ValueError: Procedure probably called with too many arguments (4 bytes in excess)
Traceback (most recent call last):
File "_ctypes/callbacks.c", line 315, in 'calling callback function'
File "C:\python projects local\bot-master\lib\InterceptionWrapper.py", line 161, in __interception_is_keyboard
return self.interceptionDll.interception_is_keyboard(device)
ValueError: Procedure probably called with too many arguments (4 bytes in excess)
Traceback (most recent call last):
File "_ctypes/callbacks.c", line 315, in 'calling callback function'
File "C:\python projects local\bot-master\lib\InterceptionWrapper.py", line 161, in __interception_is_keyboard
return self.interceptionDll.interception_is_keyboard(device)
ValueError: Procedure probably called with too many arguments (4 bytes in excess)
Traceback (most recent call last):
File "_ctypes/callbacks.c", line 315, in 'calling callback function'
File "C:\python projects local\bot-master\lib\InterceptionWrapper.py", line 161, in __interception_is_keyboard
return self.interceptionDll.interception_is_keyboard(device)
ValueError: Procedure probably called with too many arguments (4 bytes in excess)
Traceback (most recent call last):
File "_ctypes/callbacks.c", line 315, in 'calling callback function'
File "C:\python projects local\bot-master\lib\InterceptionWrapper.py", line 161, in __interception_is_keyboard
return self.interceptionDll.interception_is_keyboard(device)
ValueError: Procedure probably called with too many arguments (4 bytes in excess)
Traceback (most recent call last):
File "_ctypes/callbacks.c", line 315, in 'calling callback function'
File "C:\python projects local\bot-master\lib\InterceptionWrapper.py", line 161, in __interception_is_keyboard
return self.interceptionDll.interception_is_keyboard(device)
ValueError: Procedure probably called with too many arguments (4 bytes in excess)
Exception in thread Thread-1:
Traceback (most recent call last):
File "C:\Python27.16\Lib\threading.py", line 801, in __bootstrap_inner
self.run()
File "C:\Python27.16\Lib\threading.py", line 754, in run
self.__target(*self.__args, **self.__kwargs)
File "C:\python projects local\bot-master\launcher.py", line 66, in start_auto_py
auto.start()
File "C:\python projects local\bot-master\lib\AutoHotPy.py", line 554, in start
self.interception.interception_set_filter(self.context, self.interception.interception_is_keyboard, InterceptionFilterKeyState.INTERCEPTION_FILTER_KEY_ALL);
File "C:\python projects local\bot-master\lib\InterceptionWrapper.py", line 210, in interception_set_filter
return self.interceptionDll.interception_set_filter(context, predicate, filter1)
WindowsError: exception: access violation writing 0x00000007

no target yet
Exception in thread Thread-2:
Traceback (most recent call last):
File "C:\Python27.16\Lib\threading.py", line 801, in __bootstrap_inner
self.run()
File "C:\Python27.16\Lib\threading.py", line 754, in run
self.__target(*self.__args, **self.__kwargs)
File "C:\python projects local\bot-master\launcher.py", line 59, in start_bot
bot.loop(stop_event)
File "C:\python projects local\bot-master\character_classes\spoiler.py", line 47, in loop
if self.set_target():
File "C:\python projects local\bot-master\bot.py", line 107, in set_target
cnts = get_target_centers(img)
File "C:\python projects local\bot-master\functions.py", line 125, in get_target_centers
(_, centers, hierarchy) = cv2.findContours(closed, cv2.RETR_TREE, cv2.CHAIN_APPROX_SIMPLE)
ValueError: need more than 2 values to unpack

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants