Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ImportError: cannot import name IPAMConfig #4401

Closed
scne opened this issue Jan 29, 2017 · 9 comments
Closed

ImportError: cannot import name IPAMConfig #4401

scne opened this issue Jan 29, 2017 · 9 comments

Comments

@scne
Copy link

scne commented Jan 29, 2017

I get this error after type docker-compose --version. I've installed docker-compose with pip

$ docker-compose --version
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/dist-packages/compose/cli/main.py", line 20, in <module>
    from ..bundle import get_image_digests
  File "/usr/local/lib/python2.7/dist-packages/compose/bundle.py", line 13, in <module>
    from .network import get_network_defs_for_service
  File "/usr/local/lib/python2.7/dist-packages/compose/network.py", line 7, in <module>
    from docker.types import IPAMConfig
ImportError: cannot import name IPAMConfig
@jakubigla
Copy link

I also get similar error:
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/dist-packages/compose/cli/main.py", line 20, in <module> from ..bundle import get_image_digests File "/usr/local/lib/python2.7/dist-packages/compose/bundle.py", line 13, in <module> from .network import get_network_defs_for_service File "/usr/local/lib/python2.7/dist-packages/compose/network.py", line 7, in <module> from docker.types import IPAMConfig File "/usr/local/lib/python2.7/dist-packages/docker/types/__init__.py", line 5, in <module> from .services import ( File "/usr/local/lib/python2.7/dist-packages/docker/types/services.py", line 5, in <module> from ..utils import format_environment, split_command ImportError: cannot import name format_environment

@Gonzih
Copy link

Gonzih commented Jan 30, 2017

Same problem. Any workaround?

@scne
Copy link
Author

scne commented Jan 30, 2017

May be there is a bug, I use this workaround by @jpiron
ansible/ansible#20492

pip uninstall docker
pip uninstall docker-py
pip uninstall docker-compose
pip install docker-compose==1.9.0

@shin-
Copy link

shin- commented Jan 30, 2017

Same issue as #4344

@arno608rw
Copy link

Thank @scne

@leeyuiwah
Copy link

Solution of scne (of Jan 30, 2017) -- using docker-compose==1.9.0 work for me. The other solution on the other page of Issue #4344 (here on Jan 17, 2017) using docker==2.0.1 did not work for me.

@dhirajforyou
Copy link

May be there is a bug, I use this workaround by @jpiron
ansible/ansible#20492

pip uninstall docker
pip uninstall docker-py
pip uninstall docker-compose
pip install docker-compose==1.9.0

changed last install step( removing version) and it worked

@stefan-enway
Copy link

stefan-enway commented Oct 28, 2019

not an solution if you want a recent docker-compose though, just installed the static version via https://docs.docker.com/compose/install/

@rflume
Copy link

rflume commented Nov 19, 2019

May be there is a bug, I use this workaround by @jpiron
ansible/ansible#20492

pip uninstall docker
pip uninstall docker-py
pip uninstall docker-compose
pip install docker-compose==1.9.0

Uninstalling docker-py with pip solved the issue for me already.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants