1. 程式人生 > >windows環境下用pip安裝pyautogui遇到的幾個問題

windows環境下用pip安裝pyautogui遇到的幾個問題

local org 9.4 position setup.py pip安裝 .org 大神 ted

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。

windows環境下用pip安裝pyautogui遇到的幾個問題