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

Python——pip国内常用镜像

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

Python——pip国内常用镜像

1.国内常用镜像源如下:

清华大学:https://pypi.tuna.tsinghua.edu.cn/simple
阿里云:http://mirrors.aliyun.com/pypi/simple/
中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple/
华中理工大学:http://pypi.hustunique.com/
山东理工大学:http://pypi.sdutlinux.org/
豆瓣:http://pypi.douban.com/simple/
网易:http://mirrors.163.com

2.临时使用方法

pip install 安装包名 -i https://pypi.tuna.tsinghua.edu.cn/simple

3.永久修改 3.1windows

1.进入 C:Users当前使用用户
2.创建pip文件夹

3.在pip目录中,创建文本文档,修改文件名及格式为:pip.ini

4.用默认文本文档编辑器或者其他编辑器均可,打开 pip.ini,复制粘贴以下内容,并保存文件即可

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

1.输入 vim ~/.pip/pip.conf(vim 或 vi 均可)

2.复制粘贴以下内容

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


3.敲击Esc键 -> 输入":wp" -> 敲击回车键即可

备注:
1.若 linux 操作缺失相应权限,需使用 root 用户,或使用 sudo 完成操作
2.复制粘贴的内容中的镜像地址,可以根据实际需求进行替换

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/972721.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

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

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