# mysql\_user module error: mysql-python on Mac OSX

**URL:** <https://forum.ansible.com/t/mysql-user-module-error-mysql-python-on-mac-osx/25397>\
**Category:** Ansible Project\
**Created:** [September 2, 2017, 4:23am UTC](https://forum.ansible.com/t/mysql-user-module-error-mysql-python-on-mac-osx/25397 "2017-09-02T04:23:30Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Stephen\_Mah](https://avatars.discourse-cdn.com/v4/letter/s/65b543/32.png) [@Stephen\_Mah](https://forum.ansible.com/u/Stephen_Mah)\
**Post date:** [September 2, 2017, 4:23am UTC](https://forum.ansible.com/t/mysql-user-module-error-mysql-python-on-mac-osx/25397/1 "2017-09-02T04:23:30Z")

</div>

I’m having the following issue on my Mac running

I’m trying to run an ansible-playbook and it bombs out with the following mysql\_user command:  
mysql\_user: name=mmuser password={{ mysql\_root\_password }} priv=‘_._:ALL’ state=present

**TASK [database : create mmuser] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\***  
**fatal: [192.168.34.11]: FAILED! =\> {“changed”: false, “failed”: true, “msg”: “the python mysqldb module is required”}**

I have a few versions of Python installed. Apologies, as I’m pretty new to Python and Ansible. I must of ran an update at some point.  
I’m assuming Ansible is using 2.7.13, but /usr/bin/python is version 2.7.10.  
How do I resolve this?

My environment is MacOS version 10.12.6

ansible --version

ansible 2.3.1.0

python version = 2.7.13 |Anaconda 4.3.1 (x86\_64)| (default, Dec 20 2016, 23:05:08) [GCC 4.2.1 Stephens-MacBook-Pro:~ steve$ pip list |grep -i mysql

MySQL-python (1.2.5)

Stephens-MacBook-Pro:~ steve$ which python

/Users/steve/anaconda/bin/python

# ansible --version

ansible 2.3.1.0

python version = 2.7.13 |Anaconda 4.3.1 (x86\_64)| (default, Dec 20 2016, 23:05:08) [GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.57)]

ROOT USER:

Stephens-MacBook-Pro:~ root# which python

/usr/bin/python

Stephens-MacBook-Pro:~ root# which python

/usr/bin/python

Stephens-MacBook-Pro:~ root# python --version

Python 2.7.10

pip list|grep -i mysql

MySQL-python (1.2.5)

thanks for the help

-Steve
