Python - pip 加速

# 持久加速
mkdir -p ~/.pip
# 清华 source
cat << EOF > ~/.pip/pip.conf
[global]
index-url = https://pypi.tuna.tsinghua.edu.cn/simple
[install]
trusted-host = pypi.tuna.tsinghua.edu.cn
EOF
# 豆瓣源 source 
cat << EOF > ~/.pip/pip.conf
[global]
index-url = https://pypi.douban.com/simple
[install]
trusted-host = pypi.douban.com
EOF
#临时加速
pip install -i http://mirrors.aliyun.com/pypi/simple --trusted-host mirrors.aliyun.com/pypi/simple/ packagename
posted @ 2023-10-31 20:04  Rocky_940120  阅读(18)  评论(0编辑  收藏  举报