compose: pip install of docker-compose 1.7.1 fails

DESCRIPTION

On Ubuntu Trusty Tahr 14.04, pip install of docker-compose does not install all the dependencies it seems, so running docker-compose results in traceback:

$ sudo pip install docker-compose
$ docker-compose
Traceback (most recent call last):
  File "/usr/local/bin/docker-compose", line 5, in <module>
    from pkg_resources import load_entry_point
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2749, in <module>
    working_set = WorkingSet._build_master()
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 446, in _build_master
    return cls._build_from_requirements(__requires__)
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 459, in _build_from_requirements
    dists = ws.resolve(reqs, Environment())
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 628, in resolve
    raise DistributionNotFound(req)
pkg_resources.DistributionNotFound: backports.ssl-match-hostname>=3.5

This can be fixed by updating the dependent package:

$ sudo pip install backports.ssl_match_hostname --upgrade

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Reactions: 34
  • Comments: 20

Most upvoted comments

I prefer using the force upgrade for this

$ sudo pip install docker-compose --force --upgrade

You should update the dependent package backports.ssl_match_hostname:

[sudo] pip install --upgrade backports.ssl_match_hostname

Fix my problem

sudo apt-get install build-essential autoconf libtool pkg-config python-opengl python-imaging python-pyrex python-pyside.qtopengl idle-python2.7 qt4-dev-tools qt4-designer libqtgui4 libqtcore4 libqt4-xml libqt4-test libqt4-script libqt4-network libqt4-dbus python-qt4 python-qt4-gl libgle3 python-dev

sudo easy_install greenlet

sudo easy_install gevent

sudo pip install docker-compose --force --upgrade

I really hope compose will become a part of docker one day. So we can all just do docker compose and be happy… 😃

You can also use the docker/compose image, something like this in your .profile removes a lot of pain;

docker-compose() {  docker run -it --rm -w /data/$(basename ${PWD}) -v /var/run/docker.sock:/var/run/docker.sock -v ${PWD}:/data/$(basename ${PWD}) docker/compose:1.9.0 "$@"; }

Your docker-compose function should handle most of what we normally use it for now. Even tho it now takes half a second extra to start…

Going to +1 this, Docker Compose 1.8.0 fails in the same way on a stock Oracle Linux 7 installation (Meaning this fails on CentOS and RHEL as well)

yum install python-pip pip install -U pip pip install docker-compose

Running Docker-Compose at this point from the standard command line provides the traceback error.

–force or --upgrade should NOT be needed on any command lines given docker-compose is not there by default and this is NOT an upgrade installation.

Please either document the need to pip install backports.ssl_match_hostname or include it within the dependencies because it’s NOT getting resolved correctly.

Are we suggesting the default system packages are getting in the way of the pip installation of docker understanding that backports.ssl_match_hostname is a dependency?