Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

Do you have to install both docker and docker py?


Asked by Leia Lozano on Dec 02, 2021 Docker



Please install only one of docker or docker-py. Installing both will result in a broken installation. If this happens, Ansible will detect it and inform you about it. If that happens, you must uninstall both and reinstall the correct version. If in doubt, always install docker and never docker-py.
One may also ask,
Docker-compose 1.10+ now requires docker instead of docker-py. And due to his name the docker package is before the docker-py one in the PYTHONPATH leading to the import error. A workaround is to downgrade your docker-compose version to 1.9.0 the time the Ansible docker_container module updates its dependencies from docker-py to docker.
Next, Tox-docker requires tox to be run in Python 3.6 or newer, and requires tox version 3.0 or newer. Older versions of tox-docker may work with older versions of Python or tox, but these configurations are no longer supported. Tox-docker uses black and isort to enforce style standards on the codebase.
Additionally,
To generate a Docker image we need to create a Dockerfile which contains instructions needed to build the image. The Dockerfile is then processed by the Docker builder which generates the Docker image. Then, with a simple docker run command, we create and run a container with the Python service.
Subsequently,
This is because new versions of python modules docker and docker-py that ansible uses are incompatible. I had to revert back and explicitly specify the following versions of PIP packages: All my play books work fine since then. For me specifying the path to docker-py worked. Basically Ansible was looking in the wrong directory.