python3使用pip安装pyautogui一直出错

之前安装pyautogui一直没问题的,重装系统以后怎么都安装不上,卸载了anaconda又装了一遍也没用
直接

pip install pyautogui

报错

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb5 in position 17: invalid start byte
You are using pip version 9.0.1, however version 19.0.3 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.

网上说是必须先安装Xlib

pip install xlib

继续

pip install pyautogui

继续报错

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb5 in position 17: invalid start byte
You are using pip version 9.0.1, however version 19.0.3 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.

然后又说需要更新pip

python -m pip install --upgrade pip
Successfully installed pip-19.0.3

继续

pip install pyautogui

继续报错

Command "python setup.py egg_info" failed with error code 1 in C:\Users\盗号\AppData\Local\Temp\pip-install-5g3pvyc8\pygetwindow\

最后就是降低PyGetWindow的版本,默认安装的PyAutoGUI-0.9.41,依赖的是PyGetWindow-0.0.4
继续

pip install PyGetWindow==0.0.1

最后

pip install pyautogui

成了

Successfully built pyautogui pymsgbox PyTweening pyscreeze
Installing collected packages: pymsgbox, PyTweening, pyscreeze, pyautogui
Successfully installed PyTweening-1.0.3 pyautogui-0.9.41 pymsgbox-1.0.6 pyscreeze-0.1.19

你可能感兴趣的:(报错)