absolute import error for centos 5 environment

Hi,

While i am just testing ping adhoc command for my Centos5 environment below is the error i got

$ ansible all -i tmp3.txt -m ping -u root -k

TESTSRV | FAILED! => {
“changed”: false,
“failed”: true,
“module_stderr”: “”,
“module_stdout”: " File "/tmp/ansible_nEiCUn/ansible_module_ping.py", line 8\r\n from future import absolute_import, division, print_function\r\nSyntaxError: future feature absolute_import is not defined\r\n",
“msg”: “MODULE FAILURE”,
“rc”: 0
}

✗ pip show ansible
Name: ansible
Version: 2.4.1.0
Summary: Radically simple IT automation
Home-page: https://ansible.com/
Author: Ansible, Inc.
Author-email: info@ansible.com
License: GPLv3+
Location: /Users/foo/ansible-playbooks/venv/lib/python2.7/site-packages
Requires: jinja2, PyYAML, setuptools, cryptography, paramiko

at the TESTSRV

cat /etc/redhat-release

CentOS release 5.4 (Final)

python

Python 2.4.3 (#1, Jan 9 2013, 06:47:03)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-54)] on linux2
Type “help”, “copyright”, “credits” or “license” for more information.

Any idea what is missing at the remote side?

You need a newer version of python or an older version of ansible. Ansible-2.3 was the last release series to support python-2.4 on the managed machines (it still required python-2.6 or greater on the controller but you could manage machines with only python 2.4 installed ).

-Toshio

Installing Python 2.7 and setting the right path solved the issue. Thank you.