Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Docker-compose Install: No module named docker.errors


I'm facing this issue when I'm installing docker-compose

OS: ubuntu 14.04

docker --version
Docker version 17.05.0-ce, build 89658be

pip freeze | grep docker
docker==2.5.1
docker-pycreds==0.2.1
dockerpty==0.4.1

pip install docker-compose
Installing collected packages: docker-compose
Successfully installed docker-compose-1.17.0

docker-compose --version

Traceback (most recent call last):
File "/usr/local/bin/docker-compose", line 7, in 
from compose.cli.main import main
File "/usr/local/lib/python2.7/dist-packages/compose/cli/main.py", line 17, 
in from . import errors
File "/usr/local/lib/python2.7/dist-packages/compose/cli/errors.py", line 
11, in from docker.errors import APIError
ImportError: No module named docker.errors

Any solution for this error , thank you for your help.

like image 475
Baini.Marouane Avatar asked Nov 06 '17 08:11

Baini.Marouane


1 Answers

I'm in later versions of those packages. But I had the exact same error and installing "requests" package in a recent version did fix the problem.

docker==3.5.0
docker-compose==1.22.0
docker-dev==1.0b2
docker-py==1.10.6
docker-pycreds==0.3.0
dockerpty==0.4.1
requests==2.18.4

However, I then got another error: https://github.com/docker/compose/issues/4401

Applying the change proposed in comments did the trick:

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

Then I got into a third error: https://github.com/docker/docker-py/issues/1916

That I fixed by uninstalling the docker-py pip package which is incompatible with the docker one.

Now docker-compose works.

Hope this helps.

like image 187
nulse Avatar answered Oct 04 '22 08:10

nulse