问题描述为:
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安装。