pip 安装

安装的时候经常碰到下载过慢和安装超时的情况。

可以使用镜像和重新定义默认使时间。

比如安装beautifulsoup4

pip --default-timeout=500 install beautifulsoup4 -i https://pypi.tuna.tsinghua.edu.cn/simple

正常安装是:

pip  install beautifulsoup4 

镜像安装是:

pip  install beautifulsoup4 -i https://pypi.tunha.tsinghua.edu.cn/simple

设置超时时间是:

pip --default-timeout=500 install beautifulsoup4 

常用镜像:

清华(个人常用):https://pypi.tuna.tsinghua.edu.cn/simple

豆瓣(推荐较多):https://pypi.douban.com/simple/

阿里云:https://mirrors.aliyun.com/pypi/simple/

中科大: https://pypi.mirrors.ustc.edu.cn/simple/

原文地址:https://www.cnblogs.com/qianslup/p/13743607.html