Easy Install Breaks on Install psutil task

Dear Community,

Please support me in fixing this issue. Most of the install script tasks goes fine, except when it reaches the following task. The output is also underneath.

TASK [Install psutil] ***********************************************************************************************************************************************************
task path: /tmp/.bench/bench/playbooks/roles/psutil/tasks/main.yml:2
<127.0.0.1> ESTABLISH LOCAL CONNECTION FOR USER: root
<127.0.0.1> EXEC /bin/sh -c 'echo ~root && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /root/.ansible/tmp `"&& mkdir "` echo /root/.ansible/tmp/ansible-tmp-1613153659.97-25567-162020377730210 `" && echo ansible-tmp-1613153659.97-25567-162020377730210="` echo /root/.ansible/tmp/ansible-tmp-1613153659.97-25567-162020377730210 `" ) && sleep 0'
Using module file /usr/lib/python2.7/site-packages/ansible/modules/packaging/language/pip.py
<127.0.0.1> PUT /root/.ansible/tmp/ansible-local-24423i3zpaq/tmpHXFT_Y TO /root/.ansible/tmp/ansible-tmp-1613153659.97-25567-162020377730210/AnsiballZ_pip.py
<127.0.0.1> EXEC /bin/sh -c 'chmod u+x /root/.ansible/tmp/ansible-tmp-1613153659.97-25567-162020377730210/ /root/.ansible/tmp/ansible-tmp-1613153659.97-25567-162020377730210/AnsiballZ_pip.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '/usr/bin/python2 /root/.ansible/tmp/ansible-tmp-1613153659.97-25567-162020377730210/AnsiballZ_pip.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c 'rm -f -r /root/.ansible/tmp/ansible-tmp-1613153659.97-25567-162020377730210/ > /dev/null 2>&1 && sleep 0'
fatal: [localhost]: FAILED! => {
    "changed": false, 
    "cmd": [
        "/bin/pip2", 
        "install", 
        "-U", 
        "psutil"
    ], 
    "invocation": {
        "module_args": {
            "chdir": null, 
            "editable": false, 
            "executable": null, 
            "extra_args": null, 
            "name": [
                "psutil"
            ], 
            "requirements": null, 
            "state": "latest", 
            "umask": null, 
            "version": null, 
            "virtualenv": null, 
            "virtualenv_command": "virtualenv", 
            "virtualenv_python": null, 
            "virtualenv_site_packages": false
        }
    }, 
    "msg": "stdout: Collecting psutil\n  Using cached https://files.pythonhosted.org/packages/e1/b0/7276de53321c12981717490516b7e612364f2cb372ee8901bd4a66a000d7/psutil-5.8.0.tar.gz\n    Complete output from command python setup.py egg_info:\n    /usr/lib64/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'python_requires'\n      warnings.warn(msg)\n    /usr/lib64/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'long_description_content_type'\n      warnings.warn(msg)\n    error in psutil setup command: 'extras_require' must be a dictionary whose values are strings or lists of strings containing valid project/version requirement specifiers.\n    \n    ----------------------------------------\n\n:stderr:   Cache entry deserialization failed, entry ignored\nCommand \"python setup.py egg_info\" failed with error code 1 in /tmp/pip-build-D__Cy9/psutil/\nYou are using pip version 8.1.2, however version 21.0.1 is available.\nYou should consider upgrading via the 'pip install --upgrade pip' command.\n"
}

PLAY RECAP **********************************************************************************************************************************************************************
localhost                  : ok=32   changed=4    unreachable=0    failed=1    skipped=49   rescued=0    ignored=0   

Install script run at 18:13 on 2021-02-12

I tried most possible solutions with no luck.

Distro:
CentOS Linux release 7.9.2009 (Core)
NAME=“CentOS Linux”
VERSION=“7 (Core)”
ID=“centos”
ID_LIKE=“rhel fedora”
VERSION_ID=“7”
PRETTY_NAME=“CentOS Linux 7 (Core)”

Ansible Version:
2.8.18

Hope this will help.

Dear Suresh,

Thank you very much for your reply.

I have already tried that. But, still it is not working. This is the ouput of python3 -m pip install --upgrade pip

> $ python3 -m pip install --upgrade pip
> Requirement already satisfied: pip in /usr/local/lib/python3.6/site-packages (21.0.1)

One more try this Followed hitchhiker guide, error on pip install bench - #5 by J0K3R

Thanks again Suresh.

Unforutuntately, all packages and their dependencies are installed with latest versions. I am now shifting to Manual Install. I will be preparing a documentation on that.