Hi there,
I am trying to install Ansible within a Docker container (plain Ubuntu 14.04) to be used as a test environment.
The Python version is managed by pyenv
, and I am using pip
to install Ansible. This is the output of the “pip freeze” command after installing Ansible:
root@7e408538fd38:/usr/src/myapp# pip freeze
ansible==2.0.0.2
chardet==2.3.0
colorama==0.2.5
ecdsa==0.13
html5lib==0.999
httplib2==0.8
Jinja2==2.8
MarkupSafe==0.23
paramiko==1.16.0
pycrypto==2.6.1
python-distutils-extra==2.28
PyYAML==3.11
requests==2.2.1
six==1.5.2
urllib3==1.7.1
wheel==0.24.0
When I run one of my playbooks that uses the apt
module, I get the following error indicating that the python-apt
module is missing:
fatal: [localhost]: FAILED! => {"changed": false, "failed": true, "msg": "Could not import python modules: apt, apt_pkg. Please install python-apt package."}
When trying to install python-apt module manually using pip, I get an error about more modules missing:
root@c833f66ef7c0:/usr/src/myapp# pip install python-apt
Collecting python-apt
Downloading python-apt-0.7.8.tar.bz2 (49kB)
100% |################################| 53kB 84kB/s
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-y4ASYs/python-apt/setup.py", line 6, in <module>
from DistUtilsExtra.command import *
ImportError: No module named DistUtilsExtra.command
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-y4ASYs/python-apt
I would expect these dependencies to me managed by pip when installing the Ansible package. Am I missing anything?
Any input would be appreciated.
Thanks for your help.
Angel