修改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/
相关推荐
麻雀无能为力4 分钟前
python自学笔记2 数据类型
开发语言·笔记·python
Ndmzi8 分钟前
matlab与python问题解析
python·matlab
懒大王爱吃狼13 分钟前
怎么使用python进行PostgreSQL 数据库连接?
数据库·python·postgresql
猫猫村晨总14 分钟前
网络爬虫学习之httpx的使用
爬虫·python·httpx
web1508541593516 分钟前
Python线性回归:从理论到实践的完整指南
python·机器学习·线性回归
ayiya_Oese18 分钟前
[训练和优化] 3. 模型优化
人工智能·python·深度学习·神经网络·机器学习
抽风的雨61021 分钟前
【python基础知识】Day 27 函数专题2:装饰器
开发语言·python
漫谈网络2 小时前
Python logging模块使用指南
python·logging·日志
言之。3 小时前
Python3 简易DNS服务器实现
python·dns
正在走向自律3 小时前
GpuGeek 网络加速:破解 AI 开发中的 “最后一公里” 瓶颈
网络·人工智能·python·机器学习·性能优化·gpugeek