Hi I just installed ansible and am trying to run it, but it is returning an error regarding python on my managed node. It says “No python interpreters found for host (hostname) (tried [‘python3.12’, ‘python3.11’, ‘python3.10’, ‘python3.9’, ‘python3.8’, ‘python3.7’, ‘/usr/bin/python3’, ‘python3’]”. I know that the host does have python, but it is python2. If I go to the host machine and type “python --version” it says “Python 2.7.5”. Is there a way for ansible to search for Python version 2?
This support matrix shows the versions of ansible-core
that still support python2.7. If you’re trying to manage nodes that only support python 2.7, you’ll need to ensure you’re running ansible-core
2.16 or older.
According to that matrix, 2.16 goes EoL in May of 2025, and is therefore unlikely to be a viable solution in the long run.
how do i downgrade to that specific version of ansible-core?
That depends on how you installed ansible to begin with. If you used pip, I believe you can do something like pip install ansible-core=2.16
K, I’m just gonna remove everything and start from scratch. How do I install version 2.16 of ansible?
I should add: this is on a WSL Ubuntu box.
The following will create a venv
to install ansible-core 2.16
(tested on WSL)
mkdir tmp
python -m venv tmp
cd tmp/
source bin/activate
pip install ansible-core==2.16