安装pip3
curl https://bootstrap.pypa.io/get-pip.py -o /tmp/get-pip.py && sudo python3 /tmp/get-pip.py # 一键安装脚本
pip -V # 版本校验
永久替换镜像源
# 创建目录和配置文件
mkdir -p ~/.pip
vim ~/.pip/pip.conf
# 配置文件追加内容
[global]
timeout = 6000
index-url = https://mirrors.aliyun.com/pypi/simple/
trusted-host = mirrors.aliyun.com
# 验证,执行后管辖下载地址
pip3 install django-excel
临时更换镜像源
pip3 install 库名 -i 镜像地址
pip3 install django-excel -i https://mirrors.aliyun.com/pypi/simple/
国内pip源
  • 阿里云:https://mirrors.aliyun.com/pypi/simple/
  • 清华:https://pypi.tuna.tsinghua.edu.cn/simple
  • 中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple/
  • 华中理工大学:http://pypi.hustunique.com/
  • 山东理工大学:http://pypi.sdutlinux.org/
  • 豆瓣:http://pypi.douban.com/simple/

本文地址:https://blog.csdn.net/rrr9805/article/details/111881874