pip换源

文章目录

pip换源详解

一、pip是什么

pip 是 Python 中的标准库管理器。它允许你安装和管理不属于 Python标准库 的其它软件包

二、pip换源

国内比较好的PyPI源库有

清华大学:https://pypi.tuna.tsinghua.edu.cn/simple

阿里云:http://mirrors.aliyun.com/pypi/simple

豆瓣:http://pypi.douban.com/simple

1.1临时换源

tex 复制代码
#清华源
pip install markdown -i https://pypi.tuna.tsinghua.edu.cn/simple
# 阿里源
pip install markdown -i https://mirrors.aliyun.com/pypi/simple/
# 腾讯源
pip install markdown -i http://mirrors.cloud.tencent.com/pypi/simple
# 豆瓣源
pip install markdown -i http://pypi.douban.com/simple/

临时换源就是在pip install 库 后面直接加上 -i 换源地址

1.2 永久换源

tex 复制代码
# 清华源
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
# 阿里源
pip config set global.index-url https://mirrors.aliyun.com/pypi/simple/
# 腾讯源
pip config set global.index-url http://mirrors.cloud.tencent.com/pypi/simple
# 豆瓣源
pip config set global.index-url http://pypi.douban.com/simple/# 换回默认源pip config unset global.index-url

设置完成以后直接使用pip intall 库名 即可

相关推荐
Java后端的Ai之路3 天前
【Python小知识】-pip install xxx 命令安装的 ,在电脑的哪个盘?
开发语言·python·pip·pip install
gsgbgxp4 天前
安装库是优先用conda还是pip
深度学习·ubuntu·conda·pip
玄同7654 天前
深入理解 SQLAlchemy 的 relationship:让 ORM 关联像 Python 对象一样简单
人工智能·python·sql·conda·fastapi·pip·sqlalchemy
好好学习啊天天向上5 天前
C盘容量不够,python , pip,安装包的位置
linux·python·pip
好好学习啊天天向上5 天前
conda pip更新安装路径,解决C盘容易不够的问题
python·conda·pip·2025yfb3003605
小毅&Nora6 天前
【后端】【Python】① Windows系统下Python环境变量设置指南
python·pip
理智.6297 天前
根据requirements.txt 完成环境中的依赖库导入
python·conda·pip
万粉变现经纪人7 天前
如何解决 pip install pyodbc 报错 缺少 ‘cl.exe’ 或 ‘sql.h’(ODBC 头文件)问题
数据库·python·sql·网络协议·bug·ssl·pip
AlenTech9 天前
如何解决Ubuntu中使用系统pip报错的问题,error: externally-managed-environment
linux·ubuntu·pip
C系语言9 天前
python用pip生成requirements.txt
开发语言·python·pip