Python - pip 加速

发布时间 2023-10-31 20:10:14作者: Rocky_940120
# 持久加速
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