Python pip 换源
119 字
1 分钟
Python pip 换源
Python pip 换源
常用国内源:
清华:https://pypi.tuna.tsinghua.edu.cn/simple/
阿里云:http://mirrors.aliyun.com/pypi/simple/
临时使用
可以在使用pip的时候加参数 -i https://mirrors.ustc.edu.cn/pypi/simple
例如:pip install -i https://mirrors.ustc.edu.cn/pypi/simple hjson
这样就会从阿里云这边的镜像去安装hjson库。
永久使用
Linux
新建 ~/.pip/pip.conf 文件。
mkdir ~/.pipWindows
在用户目录中创建一个pip文件夹(即 %UserProfile%\pip 目录),创建pip.ini文件。
pip.conf / pip.ini 文件写入的内容
[global]index-url = https://mirrors.ustc.edu.cn/pypi/simple[install]trusted-host = mirrors.aliyun.com文章分享
如果这篇文章对你有帮助,欢迎分享给更多人!
最后更新于 2025-03-05,距今已过 367 天
部分内容可能已过时
相关文章 智能推荐
1
Office 将编号转换为文本
Word Office 将编号转换为文本
2
在 Powershell 中创建符号链接
Powershell 在 Powershell 中创建符号链接
3
Powershell 创建快捷方式
Powershell Powershell 创建快捷方式
4
命令行颜色代码
Windows 命令行颜色代码
5
恢复经典资源管理器和右键菜单
Windows 恢复 Windows 11 经典资源管理器和右键菜单
随机文章 随机推荐