Search code examples
dockerpipcentos6supervisordeasy-install

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


I am working in a Docker container which is being created from CentOS 6. This is basically how the Dockerfile looks like:

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"]

When I run docker build . -t test for build and test the image it ends up with the following error:

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

I have tried also installing first pip and then install supervisor using pip as follow:

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

And in this case it ends up with the following error:

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')
  • I do have Internet connection
  • I am not behind any firewall and/or proxy
  • I do not have any AV since I am building the container from Fedora 27
  • I do not have any IPTables and/or SELinux enabled
  • Everything else does install properly the only thing failing is supervisor

I am missing something here? Is not supervisor supported by CentOS6? What's the right way to install this?

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

UPDATE:

After install supervisor using the recommended command pip install supervisor and try to start the container docker run test it doesn't work and I can see the following error:

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

Any ideas?


Solution

  • Your original problem (with the easy_install solution) is that PyPi, the package repository, now requires https:// connections. easy_install simply doesn't know about this, so when it tries to contact http://pypi.python.org/simple/supervisor/ it gets:

    HTTP/1.1 403 SSL is required
    

    So easy_install simply won't work.

    I'm not sure what's causing the error regarding the meld3 package, but if you're using the EPEL repositories anyway you might as well just install the python-meld package:

    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