解决pip install安装非常慢[Errno 101] 网络不可达问题
问题描述
使用pip安装seaborn提示:
1 | sudo python3.5 -m pip install seaborn |
尝试加入default-time=100
这个参数,提示:
1
2
3
4sudo python3.5 -m pip --default-time=100 install seaborn
Collecting seaborn
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ReadTimeoutError("HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Read timed out. (read timeout=100.0)",)': /packages/a8/76/220ba4420459d9c4c9c9587c6ce607bf56c25b3d3d2de62056efe482dadc/seaborn-0.9.0-py3-none-any.whl
等了半天还是安装不了
解决方法
在pip后面加入-i
参数,比如:-i https://pypi.tuna.tsinghua.edu.cn/simple
1 | sudo python3.5 -m pip --default-time=100 install seaborn -i https://pypi.tuna.tsinghua.edu.cn/simple |
下载的飞快~
据说可以一劳永逸的方法,但我还没试过,过程如下:
1 | mkdir ~/.pip |