【问题标题】:Docker build error "Cannot fetch index base URL http://pypi.python.org/simple/"Docker 构建错误“无法获取索引基础 URL http://pypi.python.org/simple/”
【发布时间】:2019-09-30 02:03:21
【问题描述】:

我正在使用 docker build . 命令构建一个 dockerfile。在构建时,我遇到以下错误:

Downloading/unpacking requests
   Cannot fetch index base URL http://pypi.python.org/simple/
   Could not find any downloads that satisfy the requirement requests
   No distributions at all found for requests

这里是 dockerfile:

FROM jonasbonno/rpi-grovepi
RUN pip install requests
RUN git clone https://github.com/keyban/fogservice.git #update
ENTRYPOINT ["python"]
CMD ["fogservice/service.py"]

可能是什么问题?

【问题讨论】:

  • 你在代理后面吗?
  • 不,我不是。我可以在浏览器中正常打开网址。

标签: git docker pip dockerfile


【解决方案1】:

你有一个pip问题,不是docker问题,你需要在你的docker文件中添加pip install --index-url https://pypi.python.org/simple/ --upgrade pip

FROM jonasbonno/rpi-grovepi
RUN pip install --index-url https://pypi.python.org/simple/ --upgrade pip
RUN hash -r
RUN pip install requests
RUN git clone https://github.com/keyban/fogservice.git #update
ENTRYPOINT ["python"]
CMD ["fogservice/service.py"]

您可以在这里找到解决方案:pip connection failure: cannot fetch index base URL http://pypi.python.org/simple/

【讨论】:

  • 您的第一行代码中有一个错字:_p_ip 中缺少“p”。由于它是单个字符更改,因此我无法自己编辑它。
猜你喜欢
  • 2013-03-08
  • 2014-07-03
  • 2014-02-13
  • 1970-01-01
  • 2019-03-22
  • 2015-01-15
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多