dockercompose的常用命令的作用(PIP安装docker-compose超时问题解决方案)
dockercompose的常用命令的作用
PIP安装docker-compose超时问题解决方案1:安装命令
pip install docker-compose
异常信息
socket.timeout: The read operation timed out
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/pip/_internal/cli/base_command.py", line 188, in _main
status = self.run(options, args)
File "/usr/local/lib/python3.6/site-packages/pip/_internal/cli/req_command.py", line 185, in wrapper
return func(self, options, args)
File "/usr/local/lib/python3.6/site-packages/pip/_internal/commands/install.py", line 333, in run
reqs, check_supported_wheels=not options.target_dir
File "/usr/local/lib/python3.6/site-packages/pip/_internal/resolution/legacy/resolver.py", line 179, in resolve
discovered_reqs.extend(self._resolve_one(requirement_set, req))
File "/usr/local/lib/python3.6/site-packages/pip/_internal/resolution/legacy/resolver.py", line 362, in _resolve_one
abstract_dist = self._get_abstract_dist_for(req_to_install)
File "/usr/local/lib/python3.6/site-packages/pip/_internal/resolution/legacy/resolver.py", line 314, in _get_abstract_dist_for
abstract_dist = self.preparer.prepare_linked_requirement(req)
File "/usr/local/lib/python3.6/site-packages/pip/_internal/operations/prepare.py", line 469, in prepare_linked_requirement
hashes=hashes,
File "/usr/local/lib/python3.6/site-packages/pip/_internal/operations/prepare.py", line 259, in unpack_url
hashes=hashes,
File "/usr/local/lib/python3.6/site-packages/pip/_internal/operations/prepare.py", line 130, in get_http_url
link, downloader, temp_dir.path, hashes
File "/usr/local/lib/python3.6/site-packages/pip/_internal/operations/prepare.py", line 281, in _download_http_url
for chunk in download.chunks:
File "/usr/local/lib/python3.6/site-packages/pip/_internal/cli/progress_bars.py", line 166, in iter
for x in it:
File "/usr/local/lib/python3.6/site-packages/pip/_internal/network/utils.py", line 39, in response_chunks
decode_content=False,
File "/usr/local/lib/python3.6/site-packages/pip/_vendor/urllib3/response.py", line 564, in stream
data = self.read(amt=amt, decode_content=decode_content)
File "/usr/local/lib/python3.6/site-packages/pip/_vendor/urllib3/response.py", line 529, in read
raise IncompleteRead(self._fp_bytes_read, self.length_remaining)
File "/usr/lib64/python3.6/contextlib.py", line 99, in __exit__
self.gen.throw(type, value, traceback)
File "/usr/local/lib/python3.6/site-packages/pip/_vendor/urllib3/response.py", line 430, in _error_catcher
raise ReadTimeoutError(self._pool, None, "Read timed out.")
pip._vendor.urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Read timed out.
网上有网友说加上超时时间,但并没有解决我这个问题。
pip --default-timeout=100 install docker-compose
这个应该是没有翻墙导致下载超时。所以需要修改pip 的源
按照网上例子,临时修改了pip的源,再次执行安装命令,也没有解决我的问题
[root@localhost bin]# pip install numpy -i https://pypi.tuna.tsinghua.edu.cn/simple/
后来又看到一篇博客,这种方式解决了我的问题,修改源借鉴的是https://blog.csdn.net/h106140873/article/details/103858931 博客。
1:在根目录下创建pip文件夹(我是使用的root用户)
mkdir ~/.pip
2:在 .pip目录中创建 pip.conf文件
touch pip.conf
3:编辑 pip.conf 文件,添加如下两行内容
[global]
index-url = https://pypi.tuna.tsinghua.edu.cn/simple
再次执行 pip --default-timeout=100 install docker-compose 命令,安装成功。并且下载速度很快
注:pip国内的一些镜像
阿里云 http://mirrors.aliyun.com/pypi/simple/
中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple/
豆瓣(douban) http://pypi.douban.com/simple/
清华大学 https://pypi.tuna.tsinghua.edu.cn/simple/
中国科学技术大学 http://pypi.mirrors.ustc.edu.cn/simple/
以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持开心学习网。
- sqlserver2012tcpip配置(Sql Server2012 使用IP地址登录服务器的配置图文教程)
- python中pip和pip3有什么区别(ISAPI-REWRITE伪静态规则写法以及说明)
- centos7上安装python(centos6.5安装python3.7.1之后无法使用pip的解决方案)
- dockercompose的常用命令的作用(PIP安装docker-compose超时问题解决方案)
- centos8配置python开发环境(CentOS6.9 Python环境配置python2.7、pip、virtualenv)
- linux下python安装pip(在Docker中的ubuntu中安装Python3和Pip的问题)
- pip默认镜像怎么设置(将pip源更换到国内镜像的详细步骤)
- python环境怎么安装pip(python2.7 安装pip的方法步骤管用)
- python3目录操作(Python3 pip3 list 出现 DEPRECATION 警告的解决方法)
- 宝塔怎么设置指定ip访问(宝塔面板如何禁止某个IPIP段访问)
- docker目录映射不起作用(关于dockerfile build过程中报/bin/sh: pip: command not found的解决方法)
- angular定义一个管道(Angular管道PIPE的介绍与使用方法)
- python编辑redis(python使用pipeline批量读写redis的方法)
- 怎么查看python的安装路径(查看python安装路径及pip安装的包列表及路径)
- ubuntu python3.7安装(详解Ubuntu16.04安装Python3.7及其pip3并切换为默认版本)
- ()
- 网友很惭愧,自己写了很多年的字,到头来还不如一名小学生写的好(自己写了很多年的字)
- 中华第一楷 张瑞龄 86岁高龄,苦练楷书71年,一幅字卖593万(中华第一楷张瑞龄)
- 冯骥才 年意(冯骥才年意)
- ()
- 百事大吉蓝底 绿底手机高清壁纸(绿底手机高清壁纸)
热门推荐
- dedecms后台关键词(DedeCms防止垃圾文章群发、垃圾评论和注册的方法)
- SQL Server中使用order by charindex按指定顺序排序
- phpstudy的默认网站根目录是什么(phpstudy v8.0创建本地站点域名教程图文)
- VS中生成与重新生成的区别
- mysql查询分区语句(MySQL中 and or 查询的优先级分析)
- laravel框架学习心得教程(Laravel5.7 Eloquent ORM快速入门详解)
- html5横向滚动(解决HTML5中滚动到底部的事件问题)
- 用python怎么找工作(利用python如何在前程无忧高效投递简历)
- dedecms安装使用教程(网站子目录安装dedecms导致网页布局混乱的解决方法)
- laravel 后台任务配置(在Laravel中使用GuzzleHttp调用第三方服务的API接口代码)
排行榜
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9