# ModuleNotFoundError when trying to execute Python using ansible

**URL:** <https://forum.ansible.com/t/modulenotfounderror-when-trying-to-execute-python-using-ansible/34205>\
**Category:** Ansible Project\
**Created:** [November 18, 2020, 1:53am UTC](https://forum.ansible.com/t/modulenotfounderror-when-trying-to-execute-python-using-ansible/34205 "2020-11-18T01:53:39Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![magae](https://avatars.discourse-cdn.com/v4/letter/m/c68b51/32.png) [@magae](https://forum.ansible.com/u/magae)\
**Post date:** [November 18, 2020, 1:53am UTC](https://forum.ansible.com/t/modulenotfounderror-when-trying-to-execute-python-using-ansible/34205/1 "2020-11-18T01:53:39Z")

</div>

Hi, everyone  
I’m trying to execute Python Files on EC2 using ansible

I got an error message like this

**'import influxdb\nModuleNotFoundError: No module named ‘influxdb’**

I installed ‘influxdb’ module on EC2  
and it works well when I connected EC2 directly and execute Python directly.

But, it doesn’t work when using ansible…

Help ! Thanks

---

<div class="post-metadata">

**Author:** ![Akasurde](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/akasurde/32/230_2.png) [@Akasurde](https://forum.ansible.com/u/Akasurde)\
**Post date:** [November 18, 2020, 4:44am UTC](https://forum.ansible.com/t/modulenotfounderror-when-trying-to-execute-python-using-ansible/34205/2 "2020-11-18T04:44:36Z")

</div>

Can you please share `ansible --version` and influxdb installed location?

There might be a difference between Python used interactively and used by Ansible.
