0
votes

I'm trying to follow this : https://www.howtoforge.com/tutorial/how-to-install-ansible-awx-with-nginx-reverse-proxy-on-ubuntu-1804/

to install AWX on ubuntu 19.04 by runnng the playbook and i'm having import error .

i try : pip uninstall docker-py pip unsintall docker-compose pip install docker-compose=1.9.0

also try

pip install constant

Python 2.7.16 (default, Apr 6 2019, 01:42:57) [GCC 8.3.0] on linux2 Type "help", "copyright", "credits" or "license" for more information.

import constants

i had this warning when installing docker-compose :

Installing collected packages: docker-py, docker-compose The script docker-compose is installed in '/home/user/.local/bin' which is not on PATH. Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location. Successfully installed docker-compose-1.9.0 docker-py-1.10.6

TASK [local_docker : Start the containers] ****************************************************************************************************************** fatal: [localhost]: FAILED! => {"changed": false, "msg": "Failed to import docker or docker-py - cannot import name constants. Try pip install docker or pip install docker-py (Python 2.6)"} to retry, use: --limit @/home/user/awx/installer/install.retry

The full traceback is: WARNING: The below traceback may not be related to the actual failure. File "/tmp/ansible_docker_service_payload_Qt5pEa/main.py", line 457, in from compose.cli.command import project_from_options File "/home/balacite/.local/lib/python2.7/site-packages/compose/cli/command.py", line 11, in from . import errors File "/home/balacite/.local/lib/python2.7/site-packages/compose/cli/errors.py", line 10, in from docker.errors import APIError File "/home/balacite/.local/lib/python2.7/site-packages/docker/init.py", line 6, in from .client import Client, AutoVersionClient, from_env # flake8: noqa File "/home/balacite/.local/lib/python2.7/site-packages/docker/client.py", line 11, in from . import api File "/home/balacite/.local/lib/python2.7/site-packages/docker/api/init.py", line 2, in from .build import BuildApiMixin File "/home/balacite/.local/lib/python2.7/site-packages/docker/api/build.py", line 9, in from .. import utils File "/home/balacite/.local/lib/python2.7/site-packages/docker/utils/init.py", line 2, in from .utils import ( File "/home/balacite/.local/lib/python2.7/site-packages/docker/utils/utils.py", line 19, in from .. import tls File "/home/balacite/.local/lib/python2.7/site-packages/docker/tls.py", line 5, in from .ssladapter import ssladapter File "/home/balacite/.local/lib/python2.7/site-packages/docker/ssladapter/init.py", line 1, in from .ssladapter import SSLAdapter # flake8: noqa File "/home/balacite/.local/lib/python2.7/site-packages/docker/ssladapter/ssladapter.py", line 21, in from backports.ssl_match_hostname import match_hostname

3

3 Answers

0
votes

can you check if docker is running?

do something like

docker ps

If it's not running try running pip install docker and let me know if any errors show up.

0
votes

Its running and i dont have problem :

user@zaymaster:~$ sudo docker ps [sudo] password for user: CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES user@zaymaster:~$

0
votes

The problem was solved by :

Ansible was using python3.7

  • pip3 install docker-compose==1.9.0