当前位置: 首页 > article >正文

pip在ubuntu下换源

一、参考资料

pip在windows下换源

pypi镜像-pypi下载地址-pypi安装教程-阿里巴巴开源镜像站

二、关键步骤

添加源

创建pip配置文件:

mkdir ~/.pip

sudo gedit ~/.pip/pip.conf

添加以下内容:

[global]
timeout = 6000
index-url = https://mirrors.aliyun.com/pypi/simple/
trusted-host = mirrors.aliyun.com

或者通过指令修改:

pip config set global.index-url  https://pypi.org/simple  

删除源:

pip config unset global.index-url

查看现在用的哪个源:

pip config list

输出结果:

(consistent_depth) C:\Users\YOYO>pip config list
global.index-url='https://mirrors.aliyun.com/pypi/simple/'
global.timeout='6000'
global.trusted-host='mirrors.aliyun.com'

其他pip源:

清华大学	   https://pypi.tuna.tsinghua.edu.cn/simple/
阿里云	        http://mirrors.aliyun.com/pypi/simple/
中国科技大学 	  https://pypi.mirrors.ustc.edu.cn/simple/
腾讯云         http://mirrors.cloud.tencent.com/pypi/simple

Pypi官方       https://pypi.org/simple/

三、FAQ

Q:pip list出现警告

DEPRECATION: The default format will switch to columns in the future. You can use --format=(legacy|columns) (or define a format=(legacy|columns) in your pip.conf under the [list] section) to disable this warning.

解决方法:修改 pip.conf 配置,添加如下内容。

sudo gedit ~/.pip/pip.conf

添加以下内容:

[list]
format=columns
或者
format=legacy

http://www.kler.cn/news/367649.html

相关文章:

  • Netty-TCP服务端粘包、拆包问题(两种格式)
  • web3对象如何连接以太网络节点
  • 微信小程序版本更新管理——实现自动更新
  • 【C语言刷力扣】1768.交替合并字符串
  • pytest 单元框架里,前置条件
  • Spring Boot驱动的Web版酒店客房管理系统
  • Android Studio超级详细讲解下载、安装配置教程(建议收藏)
  • 探索CSS动画下的按钮交互美学
  • MySQL 的元数据锁(Metadata Locks, MDL)原理详解
  • Python 协程详解----高性能爬虫
  • 适用在汽车诊断系统中的总线收发器芯片选型:CSM9241
  • Android AAR嵌套AAR打包出现问题解决方案
  • 自由学习记录(15)
  • 前端SSE-EventSource message事件执行异常问题
  • TypeScript(中)+算法(二)
  • 道可云人工智能元宇宙每日资讯|《嘉兴市推动人工智能高质量发展实施方案》发布
  • C/C++ 每日一练:二分查找
  • 【网络协议栈】Tcp协议(上)结构的解析 和 Tcp中的滑动窗口(32位确认序号、32位序号、4位首部长度、6位标记位、16为窗口大小、16位紧急指针)
  • apply call bind 简介
  • 设计模式06-结构型模式1(适配器/桥接/组合模式/Java)
  • 理解LSTM
  • 【视频混剪Demo】FFmpeg的使用【Windows】
  • codeforces _ 补题
  • 数据可视化视频制作
  • 国内动态短效sk5,http
  • MongoDB Shell 基本命令(三)生成学生脚本信息和简单查询