由于pip主要下载地址为国外的源,因此在安装软件过程中,速度一般在几k到几十k左右,而且经常会出现timeout。因此可以把pip的源更改为国内源,以提高下载速度。
临时解决
比如安装 scrapy,可以这样写
pip install scrapy -i https://pypi.tuna.tsinghua.edu.cn/simple
永久解决
# 直接更新pip的配置文件
pip install pip -U -i https://pypi.tuna.tsinghua.edu.cn/simple
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
#更新完成后就可以直接安装其他软件了。
网友评论