解决dockerfile创建镜像时pip install报错的bug

这篇具有很好参考价值的文章主要介绍了解决dockerfile创建镜像时pip install报错的bug。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。

项目场景:

使用docker-compose创建django容器


问题描述

 > [5/5] RUN /bin/bash -c 'source ~/.bashrc && python3 -m pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple':              
0.954 Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple                                                                                   
15.98 WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7fefee58f1d0>: Failed to establish a new connection: [Errno -2] Name or service not known')': /simple/aliyun-python-sdk-core/                                                                                                                        
31.50 WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7fefea3e8d10>: Failed to establish a new connection: [Errno -2] Name or service not known')': /simple/aliyun-python-sdk-core/
47.53 WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7fefea3e9710>: Failed to establish a new connection: [Errno -2] Name or service not known')': /simple/aliyun-python-sdk-core/
64.55 WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7fefea3e9f50>: Failed to establish a new connection: [Errno -2] Name or service not known')': /simple/aliyun-python-sdk-core/
83.57 WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7fefea3ea8d0>: Failed to establish a new connection: [Errno -2] Name or service not known')': /simple/aliyun-python-sdk-core/
98.59 ERROR: Could not find a version that satisfies the requirement aliyun-python-sdk-core (from versions: none)
98.59 ERROR: No matching distribution found for aliyun-python-sdk-core
113.6 WARNING: There was an error checking the latest version of pip.

解决dockerfile创建镜像时pip install报错的bug
解决dockerfile创建镜像时pip install报错的bug,bug,pip,bug


解决方案:

执行service docker restart文章来源地址https://www.toymoban.com/news/detail-728367.html

到了这里,关于解决dockerfile创建镜像时pip install报错的bug的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

  • cmd中输入npm install,回车——安装node modules依赖,出现报错的【解决方法】

    目录 1.正常情况是: 2.当前问题: 3.解决方法: 当拿到一个前端项目的代码文件夹的时候,想要启动项目。 需要打开cmd,然后在里面输入 然后显示 安装成功 =里面 没有出现红色的ERR 当前项目文件夹vue_shop中出现node modules文件夹 当前项目文件夹cms-manage 中 没有 node modules文件夹

    2024年02月11日
    浏览(54)
  • pip install configuration 报错,问题大同小异(已解决)

    最近在研究selenium时,碰巧需要装configuration包,于是乎用pip在命令行安装  结果报了: 于是开始上浏览器搜,一开始全是升级setuptools,这里贴出来几句,可能你们的问题就解决了 可我把这些执行了一遍,没解决问题,只是少了几行错( 上面的图不是最开始的错 )。 后面我想

    2024年01月20日
    浏览(39)
  • pip install pygame安装报错解决方案

    针对pip install pygame安装报错的两种不同的解决方法: 一: 若python中 已经安装好了pip ,但pip install pygame却报错的话,可以尝试以下步骤: (1)开始,输入cmd (2)pip install wheel (3)pip install pygame 二: 另一种出现错误的原因是版本问题,此时下载pygame会出现以下警告:  针对

    2024年02月11日
    浏览(34)
  • python pip install 总是报错及解决办法

    情况一 pip 正常安装完成,但是在安装库的时候出现如下界面  运行以下命令来升级pip 情况二  出现这种情况的原因:电脑里面同时存在着两个版本,python2和python3,安装的库在下载的时候找不到对应的版本 解决方法: 指定版本号即可 python -3 -m pip install 安装的库 python -3 -

    2024年02月14日
    浏览(28)
  • [Python]pip install pygame安装报错解决方案

    pip install pygame报错提示: 解决方案:whl安装 下载pygame安装包 下载地址: https://www.lfd.uci.edu/~gohlke/pythonlibs/#pygame 我安装的python版本3.11.1,win系统64位。 选择对应版本:pygame‑2.1.2‑cp311‑cp311‑win_amd64.whl 将安装包放到指定路径后进行安装 问题原因和解决思路参考: https://q.

    2023年04月09日
    浏览(31)
  • 【pip升级】使用pip安装时出现要You are using pip version 22.0.4; however, version 23.0.1 is available报错的解决方法

            使用pip安装工具包时出现如下报错,提示要升级pip:         切换路径到以上的D盘路径,切换方法为:在文件资源管理器中找到该路径,然后在路径上直接输入cmd命令,按回车即可弹出该路径下的控制台页面。         然后尝试输入以下命令升级pip:  

    2024年02月15日
    浏览(35)
  • pip install 报错:error: subprocess-exited-with-error解决方法

    使用pip install pycurl命令时报错: 原因:未知 解决: 本地安装pycurl http://www.lfd.uci.edu/~gohlke/pythonlibs/中ctrl + F 搜索pycurl 找到对应版本,安装完后问题解决

    2024年02月13日
    浏览(30)
  • python使用pip安装包报错的解决办法(ERROR: Could not find a version that satisfies the requirement XXX)

    目录 解决方法一:更换下载源 解决方法二:使用源码安装 解决方法三:通过whl文件安装 拓展:虚拟环境下通过源码安装第三方库 使用pip命令安装python包时可能会出现如下错误提示: ERROR: Could not find a version that satisfies the requirement XXX (from v ersions: none) ERROR: No matching distribu

    2024年01月19日
    浏览(75)
  • pip install 报错: Microsoft Visual C++ 14.0 is required (10M安装包,5分钟解决)

    目录 问题现象  解决办法: 1.下载文件包 2. 安装 3. 安装好之后 pip install 报错: Microsoft Visual C++ 14.0 is required 系统: win10 我们在pip安装的时候有时候会报错, 如下: 这是缺少C++库导致的,解决办法也很简单 网上一堆教程,让你下载几个G的 Visual Studio, 又慢又麻烦,而且还

    2024年02月07日
    浏览(42)
  • MAC解决pip install -r requirements.txt报错:error: externally-managed-environment

    python环境简直让人头疼,尤其有好几个版本的python、python升级等后 这里试过非常多方法:比如强制删除 毫无用处。。 最后还是使用简单老方法完美解决: 使用虚拟环境:创建、激活、安装

    2024年04月12日
    浏览(31)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包