修改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/
相关推荐
特立独行的猫A1 小时前
用仓颉语言 cj-tauri 框架,五分钟给娃做了个鸿蒙形近字游戏
java·后端·python
大可不必了5 小时前
03 函数定义和调用
开发语言·python
承渊政道6 小时前
【Python编程—从入门到实践】(记分与闯关:用Python+Pygame,打造越战越精彩的太空大战!)
开发语言·python·pycharm·游戏程序·pygame
爱学习的程序媛6 小时前
Python常用框架梳理
开发语言·后端·python·ai·web·后端框架·python框架
imgsq7 小时前
GESP Python 一到四级:备考路线与真题特点
python·青少年编程
eggwyw8 小时前
Anaconda安装卸载的详细流程指南
开发语言·python
2601_967979128 小时前
纯手写:Python安装pip完整教程,搞了几小时,终于成功
python·教程·pip·安装·包管理
Norna9 小时前
缓存文件从没写出来:一个 .json 被当成目录用了
python
aifannihao11 小时前
AI 学习第 14 课:CNN 训 6 轮卡在 0.5352,数据没打乱
pytorch·python·深度学习·cnn·学习路线
yuyuxun112 小时前
协同过滤的校园二手物品智能推荐系统的设计与实现 毕业设计-附源码40082
javascript·vue.js·spring boot·python·数据分析·django·课程设计