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文章分享
如果这篇文章对你有帮助,欢迎分享给更多人!
相关文章智能推荐
1
Word 中的 EQ 域实操
WordWord EQ 域 示例
2
VMware 创建虚拟 USB 磁盘
VMware创建一个 .vmdk 文件,虚拟机将其识别为真实的 USB 存储设备,支持热插拔模拟和完整的USB协议交互。
3
Office 将编号转换为文本
WordOffice 将编号转换为文本
4
在 Powershell 中创建符号链接
Powershell在 Powershell 中创建符号链接
5
Powershell 创建快捷方式
PowershellPowershell 创建快捷方式
随机文章随机推荐



