angstwad/docker.ubuntu

docker-compose installation fails on Ubuntu 20.04

herangstl opened this issue · 0 comments

I ran your role on a newly created Ubuntu 20.04 host, but it failed at the installation of docker-compose with this error:

`14:00:51  failed: [ubuntu-20-04] (item={u'version': u'1.9.0', u'name': u'docker-compose', u'install': True}) => {"ansible_loop_var": "item", "changed": false, "cmd": ["/usr/local/bin/pip3", "install", "docker-compose==1.9.0"], "item": {"install": true, "name": "docker-compose", "version": "1.9.0"}, "msg": "stdout: Collecting docker-compose==1.9.0\n  Downloading docker-compose-1.9.0.tar.gz (156 kB)\nCollecting cached-property<2,>=1.2.0\n  Downloading cached_property-1.5.1-py2.py3-none-any.whl (6.0 kB)\nCollecting docopt<0.7,>=0.6.1\n  Downloading docopt-0.6.2.tar.gz (25 kB)\nCollecting PyYAML<4,>=3.10\n  Downloading PyYAML-3.13.tar.gz (270 kB)\nCollecting requests!=2.11.0,<2.12,>=2.6.1\n  Downloading requests-2.11.1-py2.py3-none-any.whl (514 kB)\nCollecting texttable<0.9,>=0.8.1\n  Downloading texttable-0.8.8.tar.gz (10 kB)\nCollecting websocket-client<1.0,>=0.32.0\n  Downloading websocket_client-0.57.0-py2.py3-none-any.whl (200 kB)\nCollecting docker-py<2.0,>=1.10.6\n  Downloading docker_py-1.10.6-py2.py3-none-any.whl (50 kB)\nCollecting dockerpty<0.5,>=0.4.1\n  Downloading dockerpty-0.4.1.tar.gz (13 kB)\nRequirement already satisfied: six<2,>=1.3.0 in /usr/lib/python3/dist-packages (from docker-compose==1.9.0) (1.14.0)\nCollecting jsonschema<3,>=2.5.1\n  Downloading jsonschema-2.6.0-py2.py3-none-any.whl (39 kB)\nCollecting docker-pycreds>=0.2.1\n  Downloading docker_pycreds-0.4.0-py2.py3-none-any.whl (9.0 kB)\nBuilding wheels for collected packages: docker-compose, docopt, PyYAML, texttable, dockerpty\n  Building wheel for docker-compose (setup.py): started\n  Building wheel for docker-compose (setup.py): finished with status 'done'\n  Created wheel for docker-compose: filename=docker_compose-1.9.0-py3-none-any.whl size=78904 sha256=9afa674349bf717b87e2948d3121b8ab120e8178e49f4d44a4a904564c7d84f1\n  Stored in directory: /root/.cache/pip/wheels/9b/6f/42/e69d0296c9619754b5a99a526ec3daac2233ceb1d244fd8fc0\n  Building wheel for docopt (setup.py): started\n  Building wheel for docopt (setup.py): finished with status 'done'\n  Created wheel for docopt: filename=docopt-0.6.2-py2.py3-none-any.whl size=13704 sha256=228f164ea6d5e93161ad22bab4f2eb3cb558f003429c42c8514c4ef79ada29f4\n  Stored in directory: /root/.cache/pip/wheels/56/ea/58/ead137b087d9e326852a851351d1debf4ada529b6ac0ec4e8c\n  Building wheel for PyYAML (setup.py): started\n  Building wheel for PyYAML (setup.py): finished with status 'done'\n  Created wheel for PyYAML: filename=PyYAML-3.13-cp38-cp38-linux_x86_64.whl size=43084 sha256=71154bc1022af39bbfac8906258076c8b47e364e989e64d72ff4f7bbb3445cd0\n  Stored in directory: /root/.cache/pip/wheels/db/f2/07/5e58b12bc11255c3fc0a0aca89849050a8ec203d8b4a3c52c0\n  Building wheel for texttable (setup.py): started\n  Building wheel for texttable (setup.py): finished with status 'done'\n  Created wheel for texttable: filename=texttable-0.8.8-py3-none-any.whl size=9807 sha256=edef1b15a9f2430729d2b84dd8ef908920ce8a1a34702aad2a1347fd8ea9e137\n  Stored in directory: /root/.cache/pip/wheels/e1/38/76/9c72db0264675d24e6c557db41878c772f4ed692809dd0e767\n  Building wheel for dockerpty (setup.py): started\n  Building wheel for dockerpty (setup.py): finished with status 'done'\n  Created wheel for dockerpty: filename=dockerpty-0.4.1-py3-none-any.whl size=16604 sha256=88f26d5cbdb16b4fb1b4a7aaf498cb130c06f7a32c5933c765bc282d49cf5db5\n  Stored in directory: /root/.cache/pip/wheels/1a/58/0d/9916bf3c72e224e038beb88f669f68b61d2f274df498ff87c6\nSuccessfully built docker-compose docopt PyYAML texttable dockerpty\nInstalling collected packages: cached-property, docopt, PyYAML, requests, texttable, websocket-client, docker-pycreds, docker-py, dockerpty, jsonschema, docker-compose\n  Attempting uninstall: PyYAML\n    Found existing installation: PyYAML 5.3.1\n\n:stderr: ERROR: Cannot uninstall 'PyYAML'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.\n"}`

The problem seems to be an existing PyYaml installation.

When I manually remove PyYaml before I run your role it works fine:

sudo rm -rf /usr/lib/python3/dist-packages/yaml
sudo rm -rf /usr/lib/python3/dist-packages/PyYAML-*