python - 基于 Python 的 exe 在 CMD 处抛出错误(pynput 模块)
问题描述
所以这是它在cmd windows 10中抛出的错误。似乎与pynput有关?不太确定我能做些什么来解决这个问题并感谢任何帮助。
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
非常感谢
解决方案
我切换到了 pyinstaller 正式支持并使用的不同模块 pywinauto:
import pywinauto
pywinauto.mouse.double_click(button='left', coords=(0, 0))
这解决了这个问题。多谢你们
推荐阅读
- javascript - c3.js 改变最小/最大值改变边界
- laravel - 如何使用变量在 datepicker HTML 中显示日期?
- javascript - 选择文件时激活按钮
- python - 如何在 Flask-SQLAlchemy 数据库模型中创建并插入带有列表字段的表?
- c# - C# Regex Replace 追加一个换行符
- sql - 创建外键约束时,是否需要列名?
- c# - Microsoft.VisualBasic.Interaction 是否有等效的命名空间
- django - OperationalError,连接到另一个 Django/DB 项目
- c++ - Nan::ObjectWrap 到 Napi::Object Wrap 无法访问 JavaScript 中的属性
- wordpress - 无法让小部件出现在自定义的首页,WordPress