无法使用 easy_install 或 pip 在 CentOS 6.9 中安装主管

Not able to install supervisor in CentOS 6.9 using easy_install nor pip

我在一个从 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 安装 supervisor,如下所示:

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')

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

Note: I could install directly from repos but the version is really old: supervisor noarch 2.1-9.el6 epel I am pretty sure I will be missing a lot of features

更新:

使用推荐的命令 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

有什么想法吗?

我给你一个安装后的工作 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 问题的解决方法。

希望对您有所帮助。

您最初的问题(使用 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