Skip to content
usbuyanov edited this page Apr 22, 2019 · 1 revision

Even though my example involves AWX, I would think this solution could apply to other apps you might be trying to install...

I got the following error when I tried to setup AWX (open source/upstream version of Ansible Tower) via Docker on my RHEL7 box:

TASK [local_docker : Activate postgres container] ************************************************** fatal: [localhost]: FAILED! => {"changed": false, "msg": "Cannot have both the docker-py and docker python modules 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. It is recommended to install the docker module if no support for Python 2.6 is required. Please note that simply uninstalling one of the modules can leave the other module in a broken state."} to retry, use: --limit @/opt/awx/installer/install.retry

Despite docker-py being a listed as a prerequisite for AWX, it is actually what's causing you to get the error above. The error msg above is a bit cryptic, but docker-py has actually been deprecated in favor of the docker module and hence it says both docker-py and docker modules can't co-exist. Unless you're using Python 2.6 still (which I'm assuming doesn't support the docker module?), you shouldn't be using docker-py.

However, if you were to just uninstall docker-py it would still break as per the last line in the error msg. So what you need to do is actually:

pip uninstall docker docker-py docker-compose

pip install docker-compose

docker is a requirement for docker-compose so if you install docker-compose it will take care of both :)

Clone this wiki locally