question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

docker-py installation breaks docker-compose

See original GitHub issue

im not quite sure if this is correct, but trying to install docker-py through pip after i’ve installed docker-compose breaks docker-compose with

Traceback (most recent call last):
  File "/usr/local/bin/docker-compose", line 7, in <module>
    from compose.cli.main import main
  File "/usr/local/lib/python2.7/site-packages/compose/cli/main.py", line 20, in <module>
    from ..bundle import get_image_digests
  File "/usr/local/lib/python2.7/site-packages/compose/bundle.py", line 13, in <module>
    from .network import get_network_defs_for_service
  File "/usr/local/lib/python2.7/site-packages/compose/network.py", line 7, in <module>
    from docker.types import IPAMConfig
ImportError: cannot import name IPAMConfig

To fix that error, i just need to do the installations in this order:

pip install docker-py
pip install docker-compose

gist: https://gist.github.com/serialdoom/3a443c420aa29f9422f8c5fc73f46602

python/pip versions tried:

docker run -it python:2.7.13 bash -c 'pip --version'
pip 9.0.1 from /usr/local/lib/python2.7/site-packages (python 2.7)
docker run -it python:2.7.12 bash -c 'pip --version'
pip 8.1.2 from /usr/local/lib/python2.7/site-packages (python 2.7)

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:2
  • Comments:11

github_iconTop GitHub Comments

6reactions
serialdoomcommented, Jan 18, 2017

apparently my proposed fix doesnt quite work as its breaking docker-py.

instead of @aboutlo sulution, downgrating docker-compose to 1.9.0 also fixes the problem

5reactions
james-stephensoncommented, Jan 27, 2017

For those coming here because they are investigating this issue as a result of using ansible, you can no longer install docker-compose via pip and also use the ansible docker module together, which requires docker-py.

Our workaround was to not use the ansible docker module (unfortunately), and instead use docker directly.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Docker build breaks even though nothing in Dockerfile or ...
But I keep running into this issue, in which Docker builds successfully initially, but if I try to re-build a container after a...
Read more >
Docker Compose release notes
This release introduced a breaking change via compose-go v1.3.0 and this PR. In this release, Docker Compose recreates new resources (networks, volumes, ...
Read more >
Install Docker Compose | Docker Documentation
Follow the instructions below to install Compose on Mac, Windows, Windows Server 2016, or Linux systems, or find out about alternatives like using...
Read more >
Installing CKAN with Docker Compose
This setup stores data in named volumes, mapped to folder locations which can be networked or local storage. An alternative would be to...
Read more >
Why new Macs break your Docker build, and how to fix it
Symptom #1: You need a compiler. Consider the following Dockerfile : FROM python:3.9-slim RUN pip install ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found