pip install镜像源(更新和换源)

pip install镜像源(更新和换源)

1.pip安装依赖包默认访问的源:

因为服务器架设在国外的缘故,很多时候不好用网速不行,这时候就需要选择国内的一些安装源安装相应的包

c++ 复制代码
https://pypi.Python.org/simple/

2.设置默认源

打开cmd命令行,升级 pip 到最新的版本 (>=10.0.0) 后进行配置:

python 复制代码
#更新pip源
python -m pip install --upgrade pip
#换源    
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple

如果您的 pip 默认源的网络连接较差,临时使用本镜像站来升级 pip:

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

其他的镜像源网址:

c++ 复制代码
豆瓣						?http://pypi.douban.com/?
中国科学技术大学		    http://pypi.mirrors.ustc.edu.cn/simple/?
清华:					   https://pypi.tuna.tsinghua.edu.cn/simple
阿里云:				  http://mirrors.aliyun.com/pypi/simple/
华中理工大学:				http://pypi.hustunique.com/
山东理工大学:				http://pypi.sdutlinux.org/?
相关推荐
Sunshine for you31 分钟前
如何用FastAPI构建高性能的现代API
jvm·数据库·python
阿贵---36 分钟前
Python Web爬虫入门:使用Requests和BeautifulSoup
jvm·数据库·python
Red丶哞1 小时前
内网自建Postfix使用Python发送邮件
开发语言·python
rebekk1 小时前
pytorch custom op的简单介绍
人工智能·pytorch·python
chushiyunen1 小时前
uv使用笔记(python包的管理工具)
笔记·python·uv
曲幽1 小时前
FastAPI状态共享秘籍:别再让中间件、依赖和路由“各自为政”了!
python·fastapi·web·request·state·depends·middleware
风清扬【coder】1 小时前
Anaconda 被误删后抢救手册:数据恢复 + 环境重建应急流程
python·数据恢复·anaconda·环境重建
2401_884563241 小时前
进阶技巧与底层原理
jvm·数据库·python
2401_873204651 小时前
使用Pandas进行数据分析:从数据清洗到可视化
jvm·数据库·python
l1t1 小时前
DeepSeek 辅助编写python程序求解欧拉计划932题:2025数
开发语言·python·欧拉计划