Python
Python
2025-10-08 17:41
阅读:67
评论:0
Python 安装依赖包时指定国内镜像源
以Django为例 安装时指定 执行命令 python -m pip install Django -i https://pypi.tuna.tsinghua.edu.cn/simple/ 永久生效
以Django为例
- 安装时指定
- 执行命令 python -m pip install Django -i https://pypi.tuna.tsinghua.edu.cn/simple/
永久生效
1
2
3
4
# 设置默认镜像源pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple/# 设置信任主机pip config set global.trusted-host pypi.tuna.tsinghua.edu.cn