python安装pillow库是出现requirement_python安装pyautogui时遇到Pillow问题

执行   pip install pyautogui

提示:

Could not find a version that satisfies the requirement Pillow>=6.2.1 (from pyscreeze>=0.1.21->pyautogui) (from versions: none)

参考:https://www.jianshu.com/p/3de67550cea6     ,首先从

https://www.lfd.uci.edu/~gohlke/pythonlibs/#pillow  下载了 Pillow‑7.1.1‑cp38‑cp38‑win_amd64.whl (我安装的python3.8  win10是64位)

执行:

pip install e:\downloads\Pillow-7.1.1-cp38-cp38-win_amd64.whl

然后:

pip install pyautogui

成功。

为了输入中文,参考https://www.cnblogs.com/zwc--blog/p/11079986.html

还需要pyperclip

然后,参考https://www.cnblogs.com/ffrs/p/11358308.html和https://blog.csdn.net/wenq_yang/article/details/82910427 做个测试

另外,还有pywinauto  参考:https://www.cnblogs.com/baihuitestsoftware/articles/9317368.html

顺便写个小例子:打开计算器,然后运行脚本找计算器窗口,输入1+2=

import pyautogui,time

pyautogui.hotkey('win', 'r')

time.sleep(1)

pyautogui.press('shift')#因为默认中文输入,所以切换输入法为英文状态

pyautogui.typewrite('calc.exe')

pyautogui.press('enter')

time.sleep(3)

pyautogui.press('1')

pyautogui.press('+')

pyautogui.press('2')

pyautogui.press('=')

补充,考虑输入法的状态控制。后来添加了英文键盘,并设置热键以切换英文输入状态,参考https://jingyan.baidu.com/album/63acb44a7cfea461fdc17e5f.html?picindex=3

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值