Trying to learn ansible and I am following a geerling walkthrough using vagrant boxes. I have the vagrantfile, ansible.cfg file, and inventory all configured. Once I enter any anisble commands (Ex: ansible multi -a “hostname” or ansible -i inventory multi -a "hostname) I recieve the python interpreter error below.
Error:
[WARNING]: Unhandled error in Python interpreter discovery for host 192.168.56.5: Expecting value: line 1 column 1 (char 0)
[WARNING]: Unhandled error in Python interpreter discovery for host 192.168.56.4: Expecting value: line 1 column 1 (char 0)
[WARNING]: Unhandled error in Python interpreter discovery for host 192.168.56.6: Expecting value: line 1 column 1 (char 0)
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: SyntaxError: future feature annotations is not defined
[WARNING]: Platform linux on host 192.168.56.5 is using the discovered Python interpreter at /usr/bin/python3, but future installation of another Python interpreter could change the meaning of that path. See Interpreter Discovery — Ansible Core Documentation for
more information.
192.168.56.5 | FAILED! => {
“ansible_facts”: {
“discovered_interpreter_python”: “/usr/bin/python3”
},
“changed”: false,
“module_stderr”: “Shared connection to 192.168.56.5 closed.\r\n”,
“module_stdout”: “Traceback (most recent call last):\r\n File "/home/vagrant/.ansible/tmp/ansible-tmp-1736484789.4937925-43933-267253926311016/AnsiballZ_command.py", line 107, in \r\n _ansiballz_main()\r\n File "/home/vagrant/.ansible/tmp/ansible-tmp-1736484789.4937925-43933-267253926311016/AnsiballZ_command.py", line 99, in _ansiballz_main\r\n invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\r\n File "/home/vagrant/.ansible/tmp/ansible-tmp-1736484789.4937925-43933-267253926311016/AnsiballZ_command.py", line 44, in invoke_module\r\n from ansible.module_utils import basic\r\n File "", line 971, in _find_and_load\r\n File "", line 951, in _find_and_load_unlocked\r\n File "", line 894, in _find_spec\r\n File "", line 1157, in find_spec\r\n File "", line 1131, in _get_spec\r\n File "", line 1112, in _legacy_get_spec\r\n File "", line 441, in spec_from_loader\r\n File "", line 544, in spec_from_file_location\r\n File "/tmp/ansible_ansible.legacy.command_payload_xmg2662h/ansible_ansible.legacy.command_payload.zip/ansible/module_utils/basic.py", line 5\r\nSyntaxError: future feature annotations is not defined\r\n”,
“msg”: “MODULE FAILURE\nSee stdout/stderr for the exact error”,
“rc”: 1
}
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: SyntaxError: future feature annotations is not defined
python3 --version = Python 3.12.3
ansible --version =
ansible [core 2.17.7]
config file = /home/ipvsven/Ansible/geerling/ansible.cfg
configured module search path = [‘/home/ipvsven/.ansible/plugins/modules’, ‘/usr/share/ansible/plugins/modules’]
ansible python module location = /usr/lib/python3/dist-packages/ansible
ansible collection location = /home/ipvsven/.ansible/collections:/usr/share/ansible/collections
executable location = /usr/bin/ansible
python version = 3.12.3 [GCC 13.2.0] (/usr/bin/python3)
jinja version = 3.1.2
libyaml = True