需要先安装pyautogui
在cmd命令中输入 pip install pyautogui
在pyautogui的安装时容易报错:
Command “python setup.py egg_info” failed with error code 1 in C:\Users\80237102\AppData\Local\Temp\pip-install-m1k3v484\pygetwindow
解决方案:降低PyGetWindow版本,运行pip install PyGetWindow==0.0.1后安装PyGetWindow成功,然后再运行pip install pyautogui即可
报错的原因:安装PyGetWindow过程中默认安装的PyAutoGUI-0.9.41,但依赖的是PyGetWindow-0.0.4,导致PyGetWindow-0.0.4出现上述问题。