《Python基础》之pip换国内镜像源

目录

推荐镜像源网址:

方法一:手动换源

方法二:命令提示符指令换源

临时换源


推荐镜像源网址:

阿里云:Simple Indexhttp://mirrors.aliyun.com/pypi/simple/

华为云:Index of python-local https://mirrors.huaweicloud.com/python/ 清华云:Simple Indexhttps://pypi.tuna.tsinghua.edu.cn/simple/

方法一:手动换源

找到系统盘下 C:\Users\ 用户名 \AppData\Roaming , APPData 可能是隐藏文件,需要将隐藏关闭;
查看在 Roaming 文件夹下有没有一个 pip 文件夹,如果没有创建一个;
进入 pip 文件夹,创建一个 pip.ini 文件;
使用记事本的方式打开 pip.ini 文件,写入:

复制代码
[global]
index-url=http://mirrors.aliyun.com/pypi/simple/
[install]
trusted-host=mirrors.aliyun.com

方法二:命令提示符指令换源

win + R打开窗口输入cmd,点击确定进入命令提示符

在命令提示符中输入以下指令:

复制代码
pip config set global.index-url https://mirrors.aliyun.com/pypi/simple/

点击回车完成换源

临时换源

复制代码
pip install 库名 -i  镜像网址
相关推荐
JSON_L1 分钟前
PHP项目打包为桌面应用
开发语言·php·桌面应用
2301_822366352 分钟前
C++中的协程编程
开发语言·c++·算法
m0_736919102 分钟前
C++中的事件驱动编程
开发语言·c++·算法
上海合宙LuatOS4 分钟前
LuatOS框架的使用(1)
java·开发语言·单片机·嵌入式硬件·物联网·ios·iphone
2401_836121607 分钟前
更优雅的测试:Pytest框架入门
jvm·数据库·python
诸神缄默不语9 分钟前
如何用Python调用智谱清言GLM系API实现智能问答
python·ai·大模型·nlp·chatglm·glm·智谱清言
lxl130710 分钟前
学习C++(4)构造函数+析构函数+拷贝构造函数
开发语言·c++·学习
阿kun要赚马内12 分钟前
Qt写群聊项目(二):客户端
开发语言·c++·qt
Clarice__12 分钟前
VScode上的python使用教程
vscode·python·conda
程序员三藏15 分钟前
自动化测试步骤详解
自动化测试·软件测试·python·测试工具·程序人生·职场和发展·测试用例