Overflowerror with Python 3.7 on Windows
See original GitHub issueThe add_hotkey
function doesn’t work on Windows with Python 3.7 (64-bit):
import keyboard, time
keyboard.add_hotkey('a', print)
time.sleep(5)
The traceback:
Exception in thread Thread-1:
Traceback (most recent call last):
File "C:\Python37\lib\threading.py", line 917, in _bootstrap_inner
self.run()
File "C:\Python37\lib\threading.py", line 865, in run
self._target(*self._args, **self._kwargs)
File "C:\Python37\lib\site-packages\keyboard\__init__.py", line 292, in listen
_os_keyboard.listen(self.direct_callback)
File "C:\Python37\lib\site-packages\keyboard\_winkeyboard.py", line 560, in listen
prepare_intercept(callback)
File "C:\Python37\lib\site-packages\keyboard\_winkeyboard.py", line 553, 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
Issue Analytics
- State:
- Created 5 years ago
- Reactions:7
- Comments:15 (1 by maintainers)
Top Results From Across the Web
datetime.datetime.now() raises an OverflowError for date after ...
> I get this error when starting the interpreter in Windows subsystem for Linux (WSL). This bug is currently closed, please open a...
Read more >Python Pywin32 - ReadEventLog OverflowERROR
I'm using Python 3.7 on Windows (64 bit). Thanks in advance! python · pywin32 · Share.
Read more >How to install python 3.7 on windows 10 PC , The non ...
Ready to start learning python? You may think installing python 3.7 is the right step, I recommend starting with python 2.7 and upgrade...
Read more >Install Python on Windows | Learn 7 Useful Steps to ... - eduCBA
This dashboard is also called as the python setup pop up window, and a snap of the same is pasted below; this snap...
Read more >SciPy 1.8.0 Release Notes — SciPy v1.9.3 Manual
This release requires Python 3.8+ and NumPy 1.17.3 or greater. ... It is currently default-off due to potential issues on Windows that we...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I m also having this issue with python3.7 and windows 10. Quick and dirty fix: removing the call to
GetModuleHandleW
seems to work for my simple use case.Not just the hotkeys, any attempt to create a hook fails.