import PyMouse
前提条件,
- __init__.py 文件中将 from windows import PyMouse, PyMouseEvent 改为 from pymouse.windows import PyMouse, PyMouseEvent
- pyHook 第三方库添加(目前只更新到python3.7版本如果是3.7以上版本需要下载pyWinhook并将windows.py文件中的pyHook更改为pyWInhook)
- pip install pywin32
- (__init__.py 和 windows.py 文件的位置为 C:\Users\Administrator\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages)
import PyKeyboard
前提条件:
__init__.py 文件中加入如下代码:
1 from .inline_keyboard import InlineKeyboard 2 from .inline_pagination_keyboard import InlinePaginationKeyboard 3 from .reply_keyboard import ReplyKeyboard 4 import sys 5 6 if sys.platform.startswith('java'): 7 from .java_ import PyKeyboard 8 9 elif sys.platform == 'darwin': 10 from .mac import PyKeyboard, PyKeyboardEvent 11 12 elif sys.platform == 'win32': 13 from .windows import PyKeyboard, PyKeyboardEvent 14 15 else: 16 from .x11 import PyKeyboard, PyKeyboardEvent
如果还是报错 尝试安装如下操作:
- 安装Pyhook ,路径;https://www.lfd.uci.edu/~gohlke/pythonlibs/#pyhook .挑选合适自己的版本,在下载目录运行cmd > pip install xxx.whl
- 安装pywin32 ,安装命令:pip install pywin32 -i https://pypi.tuna.tsinghua.edu.cn/simple (其中 -i https 是代理服务器 非一般的速度)
- 安装PyUserInput ,安装命令:pip install PyUserInput -i https://pypi.tuna.tsinghua.edu.cn/simple
- 最后一步,安装pykeyboard 验证是否可以正常导入。
标签:python3.10,windows,py,PyMouse,https,import,PyKeyboard From: https://www.cnblogs.com/wynblogscc/p/17069170.html