1.环境配置(下载 python Pycharm)
2.PyUserInput安装
2.1 本地安装pyHook(https://www.lfd.uci.edu/~gohlke/pythonlibs/#pyhook)下载对应的版本
pyHook‑1.5.1‑cp37‑cp37m‑win_amd64.whl(python版本3.7 电脑64位)
2.2 使用pip下载pip install xxx/pyHook-1.5.1-cp36-cp36m-win_amd64.whl(绝对路径)
2.3 安装PyUserInput 使用指令 pip install PyUserInput
3.使用(编译以下指令如能通过则安装完成)
from pymouse import * # 模拟鼠标所使用的包
from pykeyboard import * # 模拟键盘所使用的包
4.备注:
由于网路问题安装pip install PyUserInput 时候可能会出现如下错误
ERROR: THESE PACKAGES DO NOT MATCH THE HASHES FROM THE REQUIREMENTS FILE. If you have updated the package versions, please update the hashes. Otherwise, examine the package contents carefully;
可尝试将指令换成pip install -i https://pypi.douban.com/simple PyUserInput
pip install -i https://pypi.douban.com/simple module # 使用豆瓣源
pip install -i http://mirrors.aliyun.com/pypi/simple/ module # 阿里云
pip install -i https://pypi.mirrors.ustc.edu.cn/simple/ module # 中国科技大学
pip install -i http://pypi.douban.com/simple/ module # 豆瓣(douban)
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple/ module # 清华大学
pip install -i http://pypi.mirrors.ustc.edu.cn/simple/ module # 中国科学技术大学