修改pip源地址

目录

一、国内知名pip源地址

二、针对某次安装包设置pip源地址

三、临时修改pip源配置

四、配置文件永久修改

五、常见问题


一、国内知名pip源地址

复制代码
阿里云 http://mirrors.aliyun.com/pypi/simple/
豆瓣http://pypi.douban.com/simple/
清华大学 https://pypi.tuna.tsinghua.edu.cn/simple/
中国科学技术大学 http://pypi.mirrors.ustc.edu.cn/simple/
华中科技大学http://pypi.hustunique.com/

二、针对某次安装包设置pip源地址

修改命令如下:

复制代码
pip install --upgrade pip -i https://pypi.tuna.tsinghua.edu.cn/simple

三、临时修改pip源配置

修改命令如下:

复制代码
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple 
pip config set install.trusted-host pypi.tuna.tsinghua.edu.cn

四、配置文件永久修改

新建pip配置文件

复制代码
mkdir  ~/.pip
vi  ~/.pip/pip.conf

pip.conf内容如下:

复制代码
[global]
index-url = https://pypi.tuna.tsinghua.edu.cn/simple
[install]
trusted-host = https://pypi.tuna.tsinghua.edu.cn

五、常见问题

复制代码
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7fdcbaaeb7d0>: Failed to establish a new connection: [Errno 101] Network is unreachable')': /simple/jupyter/
相关推荐
金銀銅鐵10 小时前
[Python] 基于欧几里得算法,实现分数约分计算器
python·数学
Lyn_Li12 小时前
Kaggle Top 5 | 198只股票、200条数据的金融预测——BattleFin高分方案从零复现
python·kaggle·比赛复盘·金融预测
小九九的爸爸17 小时前
前端想要入门Agent开发,要具备哪些Python基础?
python·agent·ai编程
阿耶同学18 小时前
手把手教你用 LangGraph 搭建三层嵌套 Agent 架构
python·程序员
花酒锄作田1 天前
Pydantic校验配置文件
python
hboot1 天前
AI工程师第四课 - 深度学习入门
pytorch·python·神经网络
ZhengEnCi2 天前
P2M-Matplotlib折线图完全指南-从数据可视化到趋势分析的Python绘图利器
python·matlab·数据可视化
ZhengEnCi2 天前
P2L-Matplotlib饼图完全指南-从数据可视化到图表定制的Python绘图利器
python·matlab
曲幽2 天前
你的REST接口还在“过度投喂”数据吗?——FastAPI + GraphQL实战避坑指南
python·fastapi·web·graphql·route·cors·rest·strawberry
用户8358086187912 天前
基于 Self-RAG 与列表级重排序的进阶 RAG 系统设计与实现
python