1、不能直接使用win+r运行cmd并使用pip,必须点击开始->windows系统->命令提示符,右键->以管理员身份运行
2、运行pip install pyautogui后提示You are using pip version 10.0.1, however version 19.0.1 is available.
这个是pip版本低了,根据提示运行python -m pip install --upgrade pip即可。
3、继续运行pip install pyautogui出现错误:
Using cached https://files.pythonhosted.org/packages/01/ed/56d4a369c6e18f6b239
d9ef37b3222ba308bfebf949571b2611ff7d64f1d/PyGetWindow-0.0.4.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\80237102\AppData\Local\Temp\pip-install-m1k3v484\pygetwindo
w\setup.py", line 11, in <module>
long_description = fh.read()
UnicodeDecodeError: 'gbk' codec can't decode byte 0xa2 in position 905: ille
gal multibyte sequence
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in C:\Users\80237102
\AppData\Local\Temp\pip-install-m1k3v484\pygetwindow\
这个错误是安装pyautogui过程中遇到的一个核心错误,是安装PyGetWindow过程中出现的,网上搜了一通,最后试了各种方法,就是降低PyGetWindow版本,默认安装的PyAutoGUI-0.9.41,依赖的是PyGetWindow-0.0.4,就是这个PyGetWindow-0.0.4导致了上述问题,于是网上大神说降低PyGetWindow版本,运行pip install PyGetWindow==0.0.1后安装PyGetWindow成功,然后再运行pip install pyautogui。