docker-py installation breaks docker-compose
See original GitHub issueim 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:
- Created 7 years ago
- Reactions:2
- Comments:11
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
apparently my proposed fix doesnt quite work as its breaking docker-py.
instead of @aboutlo sulution, downgrating
docker-compose
to1.9.0
also fixes the problemFor 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.