angstwad/docker.ubuntu

Docker process failing at task 'Clean previous docker-py package if installing docker'

Closed this issue · 2 comments

Hi, I'm running into the following problem:

TASK [angstwad.docker_ubuntu : Clean previous docker-py package if installing docker.] ******************************************************************************
fatal: [host]: FAILED! => {"changed": false, "cmd": ["/usr/local/bin/pip", "uninstall", "-y", "docker-py"], "msg": "\n:stderr: Traceback (most recent call last):\n  File \"/usr/local/bin/pip\", line 7, in <module>\n    from pip._internal.cli.main import main\n  File \"/usr/local/lib/python2.7/dist-packages/pip/__init__.py\", line 1, in <module>\n    from typing import List, Optional\nImportError: No module named typing\n"}

From what I can see, people have previously have issued at this task that have been resolved. Unsure what to do, as I have typing installed (see pip list below), and not sure what else the issue is? Sorry if this is a obvious question, I'm pretty new to all of this.

Package      Version
------------ -------
ansible      4.0.0
ansible-core 2.11.0
cffi         1.14.5
cryptography 3.4.7
Jinja2       3.0.1
jmespath     0.10.0
MarkupSafe   2.0.1
packaging    20.9
pip          21.1.1
pycparser    2.20
pyparsing    2.4.7
PyYAML       5.4.1
resolvelib   0.5.4
setuptools   49.2.1
typing       3.7.4.3

I thought I'd got past this - set my interpreter_python = python3, and it managed to get past this task, but then failed on the next. I reran it (without changing anything) and it's now failed on the task above again, with the error:

 fatal: []: FAILED! => {"changed": false, "cmd": ["/usr/local/bin/pip3", "uninstall", "-y", "docker-py"], 
"msg": "\n:stderr: Traceback (most recent call last):\n  
File \"/usr/local/bin/pip3\", line 7, in <module>\n    from pip._internal.cli.main import main\n  
File \"/usr/local/lib/python3.5/dist-packages/pip/_internal/cli/main.py\", line 58\n    
sys.stderr.write(f\"ERROR: {exc}\")\n                                   
^\nSyntaxError: invalid syntax\n"}