When running docker-compose
I get this error:
docker-compose --version
> ERROR: Dependency conflict: an older version of the 'docker-py' package is polluting the namespace. Run the following command to remedy the issue:
> pip uninstall docker docker-py; pip install docker
Following the instructions in the error message does not help.
The Python library for Docker was renamed from docker-py
to docker
. This caused a naming conflict, as stated in the error message, which prevents docker-compose
from functioning properly.
On both Ubuntu 14.04 and Mac OS I had to do the following to resolve the issue:
# Find out where docker is installed:
python -c "import docker; print(docker.__path__)"
> ['/usr/local/lib/python2.7/site-packages/docker']
# Find the folder with (old) docker_py files
file /usr/local/lib/python2.7/site-packages/docker_py*
> /usr/local/lib/python2.7/site-packages/docker_py-1.8.0.dist-info: directory
# (Re-)move the directory
mv /usr/local/lib/python2.7/site-packages/docker_py-1.8.0.dist-info /tmp/
# Docker Compose is now working
docker-compose --version
> docker-compose version 1.11.2, build dfed245
Thanks to @stephenpascoe for finding this solution.
Thanks @stephenpascoe