mike-telford
mike-telford

Reputation: 113

Python based exe throwing error at CMD (pynput module)

So this is the error it's throwing in cmd windows 10. Seems to be something to do with pynput? Not really sure what I can do to fix this and appreciate any help.

C:\Users\Michael\Desktop\herprogram\dist\beeb>beeb.exe
Traceback (most recent call last):
  File "C:\Users\Michael\Desktop\herprogram\beeb.py", line 5, in <module>
    import pynput
  File "c:\python38\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 493, in exec_module
    exec(bytecode, module.__dict__)
  File "pynput\__init__.py", line 40, in <module>
  File "c:\python38\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 493, in exec_module
    exec(bytecode, module.__dict__)
  File "pynput\keyboard\__init__.py", line 31, in <module>
  File "pynput\_util\__init__.py", line 76, in backend
ImportError
[11880] Failed to execute script beeb

Many thanks

Upvotes: 1

Views: 281

Answers (1)

mike-telford
mike-telford

Reputation: 113

I switched to a different module pywinauto which is officially supported by pyinstaller and used:

import pywinauto
pywinauto.mouse.double_click(button='left', coords=(0, 0))

This solved the issue. Thanks guys

Upvotes: 1

Related Questions