geerlingguy/ansible-vagrant-examples

Unable to load docker-compose

jdhanasekar opened this issue · 1 comments

Hi All,
I am getting below docker error.

"fatal: [localhost]: FAILED! => {\"changed\": false, \"msg\":
 \"Unable to load docker-compose. Try `pip install docker-compose`. Error: Traceback (most recent call last):\\n  File \\\"/tmp/ansible_docker_service_payload_OTzQ_J/__main__.py\\\", line 465, in <module>\\n    from compose import __version__ as compose_version\\nImportError: No module named compose\\n\"}", "", "PLAY RECAP *********************************************************************", "localhost                  : ok=8    changed=3    unreachable=0    failed=1    skipped=77   rescued=0    ignored=0   "]}

After installing docker_compose in Vagrant machine, I am facing python issue,

Cannot have both the docker-py and docker python modules (old and new version of Docker SDK for Python) installed together as they use the same namespace and cause a corrupt installation. Please uninstall both packages, and re-install only the docker-py or docker python module

After uninstalling docker python, I am facing other python issue which is asking to install docker-compse again. It seems issue is rotating.

Please help me to fix the issue

@jdhanasekar it sounds like you might be trying to do some of these things manually? You need to make sure you only install docker and not docker-py as having both can cause weird issues. I would try doing:

pip uninstall docker docker-py docker-compose
pip install docker-compose docker