栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 系统运维 > 运维 > Linux

两条命令配置pip,解决pip安装慢 linux和windows均适用

Linux 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

两条命令配置pip,解决pip安装慢 linux和windows均适用

两条命令配置pip,解决pip安装慢 linux和windows均适用

方法1方法2实质说明

方法1

pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
pip config set install.trusted-host pypi.tuna.tsinghua.edu.cn

方法2

pip config set global.index-url https://mirrors.aliyun.com/pypi/simple/
pip config set install.trusted-host mirrors.aliyun.com

其中镜像地址也可以更换如下两个。
中国科学技术大学 : https://pypi.mirrors.ustc.edu.cn/simple
豆瓣:http://pypi.douban.com/simple/

实质

自动生成配置文件,

[global]
index-url = https://pypi.tuna.tsinghua.edu.cn/simple
[install]
trusted-host = https://pypi.tuna.tsinghua.edu.cn

可通过以下命令查看

C:UserPropy38scripts>pip config list
global.index-url='https://pypi.tuna.tsinghua.edu.cn/simple'
install.trusted-host='pypi.tuna.tsinghua.edu.cn'
说明
    此方法需要python的pip在环境变量的path里或在cmd中cd到pip所在的路径
    例如下图,需要cmd中cd到 C:UserPropy38scripts
转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/752339.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号