修改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/
相关推荐
wj3055853783 小时前
课程 9:模型测试记录与 Prompt 策略
linux·人工智能·python·comfyui
星寂樱易李4 小时前
iperf3 + Python-- 网络带宽、网速、网络稳定性
开发语言·网络·python
qingfeng154154 小时前
企业微信机器人开发:如何实现自动化与智能运营?
人工智能·python·机器人·自动化·企业微信
彦为君7 小时前
Agent 安全:从权限提示到沙箱隔离
python·ai·ai编程
PILIPALAPENG8 小时前
Python 语法速成指南:前端开发者视角(JS 类比版)
前端·人工智能·python
用户8356290780518 小时前
Python 操作 PowerPoint 页眉与页脚指南
后端·python
枫叶林FYL9 小时前
项目九:异步高性能爬虫与数据采集中枢 —— 基于 Crawl<sub>4</sub>AI 与 Playwright 的现代化数据采集平台 项目总览
爬虫·python·深度学习·wpf
猫猫的小茶馆9 小时前
【Python】函数与模块化编程
linux·开发语言·arm开发·驱动开发·python·stm32
Miss_min10 小时前
128K长序列数据生成
开发语言·python·深度学习