PyCharm\VsCode——Python第三方库下载换源

为什么要换源?

Python第三方库下载默认镜像源在国外,因为特殊的原因在国内的你我利用这个镜像源往往速度会非常地慢,因此为了提速将这个默认镜像源换成国内的镜像源是非常有必要的。

镜像源的种类有哪些?

|--------|------------------------------------------|
| 清华镜像源 | https://pypi.tuna.tsinghua.edu.cn/simple |
| 阿里云镜像源 | http://mirrors.aliyun.com/pypi/simple |
| 中科大镜像源 | https://pypi.mirrors.ustc.edu.cn/simple |

换源的方法有哪些?

  • 全局替换------一劳永逸

win+R键进入shell终端,在shell终端输入以下命令

复制代码
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
  • 单次替换

在shell终端输入以下命令

复制代码
pip install -i <镜像源> <第三方库名>

例如:此次安装pandas第三方库是在清华镜像源中拉取的pandas

复制代码
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple pandas
相关推荐
helloweilei20 小时前
python 抽象基类
python
用户83562907805121 小时前
Python 实现 PPT 转 HTML
后端·python
zone77391 天前
004:RAG 入门-LangChain读取PDF
后端·python·面试
zone77391 天前
005:RAG 入门-LangChain读取表格数据
后端·python·agent
树獭非懒2 天前
AI大模型小白手册|Embedding 与向量数据库
后端·python·llm
唐叔在学习2 天前
就算没有服务器,我照样能够同步数据
后端·python·程序员
曲幽2 天前
FastAPI流式输出实战与避坑指南:让AI像人一样“边想边说”
python·ai·fastapi·web·stream·chat·async·generator·ollama
Flittly2 天前
【从零手写 AI Agent:learn-claude-code 项目实战笔记】(1)The Agent Loop (智能体循环)
python·agent
vivo互联网技术2 天前
ICLR2026 | 视频虚化新突破!Any-to-Bokeh 一键生成电影感连贯效果
人工智能·python·深度学习