0

I've used Pyinstaller and cx_freeze to convert a Python code to .exe and with both of them, I get an error when I run the executable. It's a CLI OpenCV program and works properly from source code.

I'm using Windows 10 and the version of Python is 3.6.4. I've tried this in Linux and there it works.

Output:

1. Generate Dataset. (No data has been generated yet.)
2. Exit
3. Enter Camera Address


Exception in thread Thread-1:
Traceback (most recent call last):
File "C:\Users\imi_4\AppData\Local\Programs\Python\Python36\lib\threading.py", line 916, in _bootstrap_inner
    self.run()
File "C:\Users\imi_4\AppData\Local\Programs\Python\Python36\lib\threading.py", line 864, in run
    self._target(*self._args, **self._kwargs)
File "C:\Users\imi_4\AppData\Local\Programs\Python\Python36\lib\site-packages\keyboard\__init__.py", line 296, in listen
    _os_keyboard.listen(self.direct_callback)
File "C:\Users\imi_4\AppData\Local\Programs\Python\Python36\lib\site-packages\keyboard\_winkeyboard.py", line 562, in listen
    prepare_intercept(callback)
File "C:\Users\imi_4\AppData\Local\Programs\Python\Python36\lib\site-packages\keyboard\_winkeyboard.py", line 555, in prepare_intercept
    keyboard_hook = SetWindowsHookEx(WH_KEYBOARD_LL, keyboard_callback, GetModuleHandleW(NULL), NULL)
ctypes.ArgumentError: argument 3: <class 'OverflowError'>: int too long to convert
  • some of your `int`s is way too large to be converted to ctype, try and see if you can cast it to a `long int` or similar. Look at [this](https://stackoverflow.com/a/27472659/7654934) answer, might help you! – N. Ivanov Apr 10 '18 at 13:59
  • 1
    Please include the relevant code within your question, if you have questions please review [How to create a Minimal, Complete, and Verifiable example](https://stackoverflow.com/help/mcve) – Stefan Crain Apr 10 '18 at 14:03
  • Probably you didn't define `argtypes` and `restype` for the function. Check https://stackoverflow.com/questions/48788549/python-ctypes-oserror-exception-access-violation-writing-0xfffffffffa1c001/48811895#48811895 for more details defining them. But, without the code it's just a wild guess. – CristiFati Apr 10 '18 at 16:56

0 Answers0