問題描述爲:
Cannot unpack file C:\Users\ADMINI~1\AppData\Local\Temp\pip-5eqm_5bi-unpack\simple.htm (downloaded from C:\Users\ADMINI~1\AppData\Local\Temp\pip-pc_acspb-build, content-type: text/html); cannot detect archive format
Cannot determine archive format of C:\Users\ADMINI~1\AppData\Local\Temp\pip-pc_acspb-build
You are using pip version 9.0.3, however version 20.1.1 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.
導致出現版本不匹配的原因可以從兩個方面排查:
1.首先可能是由於pip下載時網站不穩定導致的,可以換一個網站,這裏使用的是豆瓣的鏡像,使用該命令:
pip install seaborn -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com
2.若依然報錯,怎表面需要升級該pip再使用上面的命令進行安裝,升級的命令如下:
python -m pip install -U pip
我安裝的時候遇到的是第二種情況,截圖如下:
首先是更新了一下pip: python -m pip install -U pip
更新成功後,再安裝seaborn庫,要是使用簡單的pip install seaborn命令仍然會報錯,報錯如下
這是由於網絡原因導致的,使用上述的 pip install seaborn -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com即可successfully安裝。