python3:12 ModuleNotFoundError: No module named 'ansible.module_utils.six.moves' error when running ansible
andrewhibbert opened this issue · comments
In the latest image if you install ansible then try to run it you get the following:
root@4a18f94e78a7:/usr/local/lib# ansible --version
Traceback (most recent call last):
File "/usr/local/bin/ansible", line 62, in <module>
import ansible.constants as C
File "/usr/local/lib/python3.12/site-packages/ansible/constants.py", line 19, in <module>
from ansible.config.manager import ConfigManager, ensure_type, get_ini_config_value
File "/usr/local/lib/python3.12/site-packages/ansible/config/manager.py", line 29, in <module>
from ansible.module_utils.six.moves import configparser
ModuleNotFoundError: No module named 'ansible.module_utils.six.moves'
Ansible was installed as follows:
pip install --no-cache-dir ansible==2.9.13
Please report that to the Ansible project. Most likely, the Ansible is not compatible with Python 3.12 overall.
Closing this, later versions of ansible work fine with this image