Broken dependency on six
Trying to use ansible on Amazon Linux EC instances with docker-py. My playbook does this:
- command: easy_install pip creates=/usr/bin/pip
- command: pip install docker-py creates=/usr/lib/python2.6/site-packages/docker/client.py
- command: pip install --upgrade six
The last step should not be necessary but if I omit it I get this:
failed: [54.172.99.39] => {"failed": true, "parsed": false}
invalid output was: SUDO-SUCCESS-fivtwwcvtrwybqrmybkqqvlzvtlnqjqw
Traceback (most recent call last):
File "/home/ec2-user/.ansible/tmp/ansible-tmp-1412696774.24-69218506797267/docker", line 312, in
FATAL: all hosts have already failed -- aborting
Having a similar problem with python 2.7
fatal: [ec2] => failed to parse: sudo: unable to resolve host ip-10-10-13-87
sudo: unable to resolve host ip-10-10-13-87
SUDO-SUCCESS-kefkggunwgxqydlrtskqnagxkxyturbw
Traceback (most recent call last):
File "/home/ubuntu/.ansible/tmp/ansible-tmp-1413477069.2-52467766880601/docker_image", line 1598, in
FATAL: all hosts have already failed -- aborting
Similar problem happened to me with python2.7 and local machine
With six 1.3 (written as dependency in setup.py), got following erors.
$ sudo pip install six==1.3
$ python
>>> import docker
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.7/site-packages/docker/__init__.py", line 20, in <module>
from .client import Client, AutoVersionClient # flake8: noqa
File "/usr/lib/python2.7/site-packages/docker/client.py", line 35, in <module>
import websocket
File "/usr/lib/python2.7/site-packages/websocket/__init__.py", line 22, in <module>
from ._core import *
File "/usr/lib/python2.7/site-packages/websocket/_core.py", line 41, in <module>
from ._url import *
File "/usr/lib/python2.7/site-packages/websocket/_url.py", line 23, in <module>
from six.moves.urllib.parse import urlparse
ImportError: No module named urllib.parse
With six 1.4, works correctly.
$ sudo pip install six==1.4
$ python
Python 2.7.5 (default, May 5 2014, 09:13:10)
[GCC 4.8.2 20140120 (Red Hat 4.8.2-16)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import docker
Hm, it would probably be wise to require a more recent version of six. Thanks for reporting this.
Encountered this problem today. Thanks for the workaround @Hi-king !
Also encountered on my system: CentOS 7 with Python 2.7.5. Thks @Hi-king !