# "ERROR! module (ec2) is missing interpreter line"

**URL:** <https://forum.ansible.com/t/error-module-ec2-is-missing-interpreter-line/20278>\
**Category:** Ansible Project\
**Created:** [January 19, 2016, 4:09pm UTC](https://forum.ansible.com/t/error-module-ec2-is-missing-interpreter-line/20278 "2016-01-19T16:09:53Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jim\_Razmus\_II](https://avatars.discourse-cdn.com/v4/letter/j/5fc32e/32.png) [@Jim\_Razmus\_II](https://forum.ansible.com/u/Jim_Razmus_II)\
**Post date:** [January 19, 2016, 4:09pm UTC](https://forum.ansible.com/t/error-module-ec2-is-missing-interpreter-line/20278/1 "2016-01-19T16:09:53Z")

</div>

I’m running a simple play to create an ec2 instance and encountering the error mentioned in the subject. Something must be wrong with my setup but I don’t know what it could be. I’m running Ansible from a clone of the repo on github. I’ve sourced the hacking/env\_setup file and have many other plays using other ec2\_\* modules that work. I have boto and boto3 installed and I’m running on Mac OS 10.11.2.

I’d sincerely appreciate any pointers on how to correct my setup.

I’ve tried some of the plays documented with the ec2 module and always get the same error. Here’s the play I’m trying to run:

- ec2:

image: “{{ linux\_image }}”

instance\_type: “{{ instance\_type }}”

key\_name: “{{ key\_name }}”

region: “{{ region }}”

state: present

vpc\_subnet\_id: “{{ public\_subnet\_a }}”

The variables have appropriate values assigned. I’ve even tried the play with hard coded values and get the same error.

What baffles me is that ec2 fails while all the other ec2\_\* modules work. What am I missing?

Thanks in advance,  
Jim

---

<div class="post-metadata">

**Author:** ![Brian\_Coca](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@Brian\_Coca](https://forum.ansible.com/u/Brian_Coca)\
**Post date:** [January 19, 2016, 4:42pm UTC](https://forum.ansible.com/t/error-module-ec2-is-missing-interpreter-line/20278/2 "2016-01-19T16:42:25Z")

</div>

some other ec2.py is being found in the python path and ansible is  
trying to use it instead of the module

---

<div class="post-metadata">

**Author:** ![Jim\_Razmus\_II](https://avatars.discourse-cdn.com/v4/letter/j/5fc32e/32.png) [@Jim\_Razmus\_II](https://forum.ansible.com/u/Jim_Razmus_II)\
**Post date:** [January 19, 2016, 5:39pm UTC](https://forum.ansible.com/t/error-module-ec2-is-missing-interpreter-line/20278/3 "2016-01-19T17:39:44Z")

</div>

I thought the same thing so I tried mv’ing conflicting files.

PYTHONPATH=/Users/jtr2/Development/github/ansible/lib:

Histogram:lib jtr2$ pwd

/Users/jtr2/Development/github/ansible/lib

Histogram:lib jtr2$ find . -name ec2.py -print

./ansible/module\_utils/ec2.py

./ansible/modules/core/cloud/amazon/ec2.py

./ansible/utils/module\_docs\_fragments/ec2.py

mv ansible/utils/module\_docs\_fragments/ec2.py ansible/utils/module\_docs\_fragments/ec2.py.bak

But I still get the same result. I’m scratching my head.

Any other ideas?
