cant install dependencies for mysql and flask

[test@ip-172-31-1-143 ~]$ ansible-playbook /home/test/AQ-Project2/playbook.yml -i /home/test/AQ-Project2/inventory.txt

PLAY [Deploy a web application] ****************************************************************

TASK [Gathering Facts] *************************************************************************
ok: [db_and_web_server]

TASK [Install dependencies] ********************************************************************
failed: [db_and_web_server] (item=[u’python’, u’python-setuptools’, u’python-dev’, u’build-essential’, u’python-pip’, u’python-mysqldb’]) => {“changed”: false, “failed”: true, “item”: [“python”, “python-setuptools”, “python-dev”, “build-essential”, “python-pip”, “python-mysqldb”], “msg”: “No package matching ‘python-dev’ found available, installed or updated”, “rc”: 126, “results”: [“python-2.7.14-58.amzn2.0.4.x86_64 providing python is already installed”, “python2-setuptools-38.4.0-3.amzn2.0.6.noarch providing python-setuptools is already installed”, “No package matching ‘python-dev’ found available, installed or updated”]}
to retry, use: --limit @/home/test/Anas-Project2/playbook.retry

PLAY RECAP *************************************************************************************
db_and_web_server : ok=1 changed=0 unreachable=0 failed=1

Hi,

depending on your distribution the packages might have a different name. Have you tried installing python-dev manually. It might be named python2-dev.

Kind regards,
Sascha

still doesn’t work:

[test@ip-172-31-1-143 ~]$ ansible webservers -m yum -a ‘name=python2-dev state=present’ -u test --become --ask-become-pass
SUDO password:
172.31.13.61 | FAILED! => {
“changed”: false,
“failed”: true,
“msg”: “No package matching ‘python2-dev’ found available, installed or updated”,
“rc”: 126,
“results”: [
“No package matching ‘python2-dev’ found available, installed or updated”
]
}

You don't make it particularly easy for to help you by not providing a
playbook, or details about the host you're trying to manage.
But, there are a few bits of information buried in that error you posted.
Most importantly the string 'amzn' in one of the the package names
suggests that you're using an AWS AMI.
I think in that universe the package you're after is called "python-devel".

Dick