Compose: Missing dependency on Ubuntu 16.04

Created on 29 May 2016  ·  9Comments  ·  Source: docker/compose

I used original docker instruction (https://docs.docker.com/engine/installation/linux/ubuntulinux/) to install docker on ubuntu 16.04 that was created in GCP. It worked like a charm and manual is really great!

However, docker compose didn't work out of the box:

:~$ docker-compose --version
Traceback (most recent call last):
  File "/usr/bin/docker-compose", line 9, in <module>
    load_entry_point('docker-compose==1.5.2', 'console_scripts', 'docker-compose')()
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 542, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2569, in load_entry_point
    return ep.load()
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2229, in load
    return self.resolve()
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2235, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/usr/lib/python2.7/dist-packages/compose/cli/main.py", line 11, in <module>
    from docker.errors import APIError
  File "/usr/lib/python2.7/dist-packages/docker/__init__.py", line 20, in <module>
    from .client import Client, AutoVersionClient, from_env # flake8: noqa
  File "/usr/lib/python2.7/dist-packages/docker/client.py", line 25, in <module>
    from . import api
  File "/usr/lib/python2.7/dist-packages/docker/api/__init__.py", line 2, in <module>
    from .build import BuildApiMixin
  File "/usr/lib/python2.7/dist-packages/docker/api/build.py", line 9, in <module>
    from .. import utils
  File "/usr/lib/python2.7/dist-packages/docker/utils/__init__.py", line 1, in <module>
    from .utils import (
  File "/usr/lib/python2.7/dist-packages/docker/utils/utils.py", line 33, in <module>
    from .. import tls
  File "/usr/lib/python2.7/dist-packages/docker/tls.py", line 5, in <module>
    from .ssladapter import ssladapter
  File "/usr/lib/python2.7/dist-packages/docker/ssladapter/__init__.py", line 1, in <module>
    from .ssladapter import SSLAdapter # flake8: noqa
  File "/usr/lib/python2.7/dist-packages/docker/ssladapter/ssladapter.py", line 21, in <module>
    from .ssl_match_hostname import match_hostname
  File "/usr/lib/python2.7/dist-packages/docker/ssladapter/ssl_match_hostname.py", line 6, in <module>
    import ipaddress
ImportError: No module named ipaddress

I was able to fix it by installing python-ipaddress package:

:~$ sudo apt-get install python-ipaddress
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following NEW packages will be installed:
  python-ipaddress
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 18.0 kB of archives.
After this operation, 103 kB of additional disk space will be used.
Get:1 http://us-east1-b.gce.clouds.archive.ubuntu.com/ubuntu xenial/main amd64 python-ipaddress all 1.0.16-1 [18.0 kB]
Fetched 18.0 kB in 0s (48.2 kB/s)     
Selecting previously unselected package python-ipaddress.
(Reading database ... 64040 files and directories currently installed.)
Preparing to unpack .../python-ipaddress_1.0.16-1_all.deb ...
Unpacking python-ipaddress (1.0.16-1) ...
Setting up python-ipaddress (1.0.16-1) ...
:~$ docker-compose --version
docker-compose version 1.5.2, build unknown

Most helpful comment

had this also with fresh install of Ubuntu 16.04. Install python-ipaddress package resolved problem.

All 9 comments

@dooman87 which python are you using, IIRC 16.04 uses Python 3.5 as default one. If so, docker-compose doesn't support it yet. And it looks like that this is a problem of python docker client but not compose itself.

@denismakogon nope, it's 2.7:

:~$ python --version
Python 2.7.11+

I'm facing the same issue on ubuntu 16.04, with python 2.7.11+ too

Let's start with documentation as initial solution. For next fixes it would
require to analyze package diff and find out what causes problem described
above.

среда, 8 июня 2016 г. пользователь Enrique García Navalón написал:

I'm facing the same issue on ubuntu 16.04, with python 2.7.11+ too


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/docker/compose/issues/3525#issuecomment-224645796,
or mute the thread
https://github.com/notifications/unsubscribe/AC5L616JjD2umGmFKDq_pzs0jUBM5guaks5qJuyXgaJpZM4IpKtk
.

@denismakogon I created a PR with a change to docs.

Thanks, I'll take a look at it.

четверг, 9 июня 2016 г. пользователь Pokidov N. Dmitry написал:

@denismakogon https://github.com/denismakogon I created a PR with a
change to docs.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/docker/compose/issues/3525#issuecomment-224751939,
or mute the thread
https://github.com/notifications/unsubscribe/AC5L64mA03-2geisq2SXfijujrSTNbAJks5qJ0RJgaJpZM4IpKtk
.

had this also with fresh install of Ubuntu 16.04. Install python-ipaddress package resolved problem.

Almost a year and Docker won't even add this to their documentation!?

Fixed in #3661

Was this page helpful?
0 / 5 - 0 ratings

Related issues

29e7e280-0d1c-4bba-98fe-f7cd3ca7500a picture 29e7e280-0d1c-4bba-98fe-f7cd3ca7500a  ·  3Comments

Hendrik-H picture Hendrik-H  ·  3Comments

saulshanabrook picture saulshanabrook  ·  3Comments

davidbarratt picture davidbarratt  ·  3Comments

DhairyashilBhosale picture DhairyashilBhosale  ·  3Comments