# NameError: name 'ansible' is not defined

**URL:** <https://forum.ansible.com/t/nameerror-name-ansible-is-not-defined/18985>\
**Category:** Ansible Project\
**Tags:** windows, ubuntu\
**Created:** [August 10, 2015, 6:31pm UTC](https://forum.ansible.com/t/nameerror-name-ansible-is-not-defined/18985 "2015-08-10T18:31:03Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Karthik\_Rengarajan](https://avatars.discourse-cdn.com/v4/letter/k/258eb7/32.png) [@Karthik\_Rengarajan](https://forum.ansible.com/u/Karthik_Rengarajan)\
**Post date:** [August 10, 2015, 6:31pm UTC](https://forum.ansible.com/t/nameerror-name-ansible-is-not-defined/18985/1 "2015-08-10T18:31:03Z")

</div>

Hi, I am new to ansible and learning ansible from a tutorial. I am using windows 7 (unfortunately) and Vagrant with VirtualBox. I have installed ansible 2.0.0 on one vagrant ubuntu box and the ansible inventory file has an entry for another ubuntu vagrant box.

When running ‘ansible all -m ping’ it returns with success message however when executing the ‘ansible-playbook ’ it returns with the below error. Can you please advise if I am missing something.

Traceback (most recent call last):  
File “/usr/local/bin/ansible-playbook”, line 5, in   
pkg\_resources.run\_script(‘ansible==2.0.0’, ‘ansible-playbook’)  
File “/usr/lib/python2.7/dist-packages/pkg\_resources.py”, line 528, in run\_script  
self.require(requires)[0].run\_script(script\_name, ns)  
File “/usr/lib/python2.7/dist-packages/pkg\_resources.py”, line 1394, in run\_script  
execfile(script\_filename, namespace, namespace)  
File “/usr/local/lib/python2.7/dist-packages/ansible-2.0.0-py2.7.egg/EGG-INFO/scripts/ansible-playbook”, line 1, in   
ansible  
NameError: name ‘ansible’ is not defined

---

<div class="post-metadata">

**Author:** ![rahul](https://avatars.discourse-cdn.com/v4/letter/r/f14d63/32.png) [@rahul](https://forum.ansible.com/u/rahul)\
**Post date:** [April 21, 2016, 6:06am UTC](https://forum.ansible.com/t/nameerror-name-ansible-is-not-defined/18985/2 "2016-04-21T06:06:03Z")

</div>

Hello,

I am currently stuck here only.I am also doing it in windows only.  
Did u find any solution.

Any help will be appreciated.

Regards,  
Rahul Pandia

---

<div class="post-metadata">

**Author:** ![Vlad\_Gorbunov](https://avatars.discourse-cdn.com/v4/letter/v/94ad74/32.png) [@Vlad\_Gorbunov](https://forum.ansible.com/u/Vlad_Gorbunov)\
**Post date:** [July 5, 2016, 12:27pm UTC](https://forum.ansible.com/t/nameerror-name-ansible-is-not-defined/18985/3 "2016-07-05T12:27:50Z")

</div>

Windows can’t make correct symlinks. Do this:  
cd /usr/local/lib/python2.7/  
dist-packages/ansible-2.0.0-py2.7.egg/EGG-INFO/scripts  
cp ansible ansible-playbook  
cp ansible ansible-console  
cp ansible ansible-doc  
cp ansible ansible-galaxy  
cp ansible ansible-pull  
cp ansible ansible-vault
