【问题标题】:Not able to install supervisor in CentOS 6.9 using easy_install nor pip无法使用 easy_install 或 pip 在 CentOS 6.9 中安装主管
【发布时间】:2018-07-02 23:50:56
【问题描述】:

我在一个从 CentOS 6 创建的 Docker 容器中工作。这基本上是 Dockerfile 的样子:

FROM centos:centos6
RUN yum update -y && \
    yum install -y epel-release && \
    yum install -y iproute python-setuptools hostname inotify-tools yum-utils which && \
    yum clean all && \
    easy_install supervisor
ADD container-files /
VOLUME ["/data"]
ENTRYPOINT ["/config/bootstrap.sh"]

当我运行 docker build . -t test 构建和测试映像时,它最终会出现以下错误:

...
Searching for supervisor
Reading http://pypi.python.org/simple/supervisor/
Couldn't find index page for 'supervisor' (maybe misspelled?)
Scanning index of all packages (this may take a while)
Reading http://pypi.python.org/simple/
No local packages or download links found for supervisor
error: Could not find suitable distribution for Requirement.parse('supervisor')

我也尝试过安装第一个 pip,然后使用 pip 安装主管,如下所示:

RUN yum update -y && \
    yum install -y epel-release && \
    yum install -y iproute python-setuptools hostname inotify-tools yum-utils which && \
    yum clean all && \
    easy_install pip && \
    pip install supervisor

在这种情况下,最终会出现以下错误:

Searching for pip
Reading http://pypi.python.org/simple/pip/
Couldn't find index page for 'pip' (maybe misspelled?)
Scanning index of all packages (this may take a while)
Reading http://pypi.python.org/simple/
No local packages or download links found for pip
error: Could not find suitable distribution for Requirement.parse('pip')
  • 我有互联网连接
  • 我不在任何防火墙和/或代理后面
  • 我没有任何 AV,因为我是从 Fedora 27 构建容器
  • 我没有启用任何 IPTables 和/或 SELinux
  • 其他一切都正确安装,唯一失败的是supervisor

我在这里遗漏了什么? CentOS6不支持supervisor吗?安装这个的正确方法是什么?

注意:我可以直接从 repos 安装,但版本真的很旧:supervisor noarch 2.1-9.el6 epel 我很确定我会丢失很多功能

更新:

使用推荐的命令pip install supervisor 安装supervisor 并尝试启动容器docker run test 后它不起作用,我可以看到以下错误:

Traceback (most recent call last):
  File "/usr/bin/supervisord", line 5, in <module>
    from pkg_resources import load_entry_point
  File "/usr/lib/python2.6/site-packages/pkg_resources.py", line 2655, in <module>
    working_set.require(__requires__)
  File "/usr/lib/python2.6/site-packages/pkg_resources.py", line 648, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/usr/lib/python2.6/site-packages/pkg_resources.py", line 546, in resolve
    raise DistributionNotFound(req)
pkg_resources.DistributionNotFound: meld3>=0.6.5

有什么想法吗?

【问题讨论】:

标签: docker pip centos6 supervisord easy-install


【解决方案1】:

您最初的问题(使用easy_install 解决方案)是包存储库PyPi 现在需要https:// 连接。 easy_install 根本不知道这一点,所以当它尝试联系 http://pypi.python.org/simple/supervisor/ 时,它会得到:

HTTP/1.1 403 SSL is required

所以easy_install 根本行不通。

我不确定是什么导致了有关 meld3 软件包的错误,但如果您仍然使用 EPEL 存储库,您最好安装 python-meld 软件包:

FROM centos:centos6
RUN yum update -y && \
    yum install -y epel-release && \
    yum install -y \
      iproute \
      python-setuptools \
      hostname \
      inotify-tools \
      yum-utils \
      which \
      python-meld3 \
      python-pip && \
    yum clean all && \
    pip install supervisor

【讨论】:

    【解决方案2】:

    我给你一个安装工作​​的 Dockerfile:

    FROM centos:centos6
    RUN yum update -y && \
        yum install -y epel-release && \
        yum install -y iproute python-setuptools hostname inotify-tools && \
        yum-utils which && \
        yum -y install python-pip && \
        yum clean all && \
        pip install supervisor
    

    easy_install 问题的解决方法。

    我希望这会有所帮助。

    【讨论】:

    • @ReynierPM 它对我来说工作正常,但我的图像只是用 mi 发布的 Dockerfile 生成的(我没有检查你的其余部分),无论如何它似乎是 mel3d 版本,或相关的东西我猜是ENTRYPOINT。 Docker 版本 17.12.0-ce,构建 c97c6d6
    • 我已经尝试过但仍然无法正常工作我不知道发生了什么,here 是我为此类容器创建的存储库。你能试试那个吗?
    • 我会在这里或通过该 repo 上的 PR 来看看并通知你。
    • @ReynierPM 我只是向您的存储库发出拉取请求,并进行了一些修改以使 python 和依赖项工作,建议,但仍然无法工作(来自 supervisord.conf 的失败,不知道确切)。还有一个解释一些事情的自述文件。
    • cool 我稍后会在家里看看,但我可以轻松地使用其他答案中提供的解决方案,而无需编译和/或安装任何东西。无论如何,这两种解决方案都是有效的,我会将您的更改合并到一个新的分支中,这样我就可以让这两种解决方案都在我身上发挥作用
    猜你喜欢
    • 2012-05-26
    • 1970-01-01
    • 1970-01-01
    • 2018-01-23
    • 2014-12-04
    • 2018-10-08
    • 1970-01-01
    • 2016-06-04
    • 2018-03-28
    相关资源
    最近更新 更多