# ImportError: No module named runner (environment issues)

**URL:** <https://forum.ansible.com/t/importerror-no-module-named-runner-environment-issues/19148>\
**Category:** Ansible Project\
**Created:** [August 31, 2015, 2:38pm UTC](https://forum.ansible.com/t/importerror-no-module-named-runner-environment-issues/19148 "2015-08-31T14:38:48Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dan\_Swartz](https://avatars.discourse-cdn.com/v4/letter/d/439d5e/32.png) [@Dan\_Swartz](https://forum.ansible.com/u/Dan_Swartz)\
**Post date:** [August 31, 2015, 2:38pm UTC](https://forum.ansible.com/t/importerror-no-module-named-runner-environment-issues/19148/1 "2015-08-31T14:38:48Z")

</div>

How I got here:  
I have been wanting to prepare for the upgrade to v2.0 for awhile now and, having just seen the alpha release, I thought I’d try it… super bad idea, it turns out. My whole environment is messed up. I had already apt-gotten it, but after this, I apt-removed it, deleted all leftover files, then reinstalled it.

My Current State:

I reinstalled everything, unfortunately, my environment is still messed. I’m experiencing the following:

> $ ansible --version
> 
> Traceback (most recent call last):
> 
> File “/usr/bin/ansible”, line 36, in
> 
> from ansible.runner import Runner
> 
> ImportError: No module named runner
> 
> $ env | grep -i ansible
> 
> $

What I need to know: What commands/actions do I need to do to get my environment in a sane state again? I can tell you that my modules, etc, are in /usr/share/pyshared/ansible… should that be my ANSIBLE\_LIBRARY? Any help would be greatly appreciated!

Some info:

---

<div class="post-metadata">

**Author:** ![Dan\_Swartz](https://avatars.discourse-cdn.com/v4/letter/d/439d5e/32.png) [@Dan\_Swartz](https://forum.ansible.com/u/Dan_Swartz)\
**Post date:** [August 31, 2015, 2:54pm UTC](https://forum.ansible.com/t/importerror-no-module-named-runner-environment-issues/19148/2 "2015-08-31T14:54:11Z")

</div>

Fixed it! Not sure exactly _how_ this fixed it:

> sudo rm -rf /usr/local/lib/python2.7/dist-packages/ansible-2.0.0-py2.7.egg

But that did the trick!

---

<div class="post-metadata">

**Author:** ![ayekaymail](https://avatars.discourse-cdn.com/v4/letter/a/ec9cab/32.png) [@ayekaymail](https://forum.ansible.com/u/ayekaymail)\
**Post date:** [September 17, 2015, 10:11pm UTC](https://forum.ansible.com/t/importerror-no-module-named-runner-environment-issues/19148/3 "2015-09-17T22:11:24Z")

</div>

thanks Dan

This worked for me too

`  
[root@myhost site-packages]# python -V  
Python 2.6.6  
[root@myhost site-packages]# lsb\_release  
LSB Version: :base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch  
[root@myhost site-packages]# /usr/bin/ansible --version  
Traceback (most recent call last):  
File “/usr/bin/ansible”, line 36, in   
from ansible.runner import Runner  
ImportError: No module named runner

[root@myhost site-packages]# pwd  
/usr/lib/python2.6/site-packages  
[root@myhost site-packages]# ls -lrth | grep ansible  
drwxr-xr-x. 4 root root 4.0K Sep 16 17:09 **ansible** \*\*-2.0.0-py2.6.egg\*\*  
drwxr-xr-x. 2 root root 4.0K Sep 17 17:58 ansible-1.9.2-py2.6.egg-info  
drwxr-xr-x. 10 root root 4.0K Sep 17 17:58 ansible  
[root@myhost site-packages]# rm -rf ansible-2.0.0-py2.6.egg  
[root@myhost site-packages]# /usr/bin/ansible --version  
ansible 1.9.2  
configured module search path = None  
`

---

<div class="post-metadata">

**Author:** ![Eduardo\_Cerqueira](https://avatars.discourse-cdn.com/v4/letter/e/f0a364/32.png) [@Eduardo\_Cerqueira](https://forum.ansible.com/u/Eduardo_Cerqueira)\
**Post date:** [January 29, 2016, 5:25pm UTC](https://forum.ansible.com/t/importerror-no-module-named-runner-environment-issues/19148/4 "2016-01-29T17:25:52Z")

</div>

same here! in my case I tested on Mac OSX El Capitan. summary: I had ansible 2.0.0.2 installed, I installed ansible==1.9.2 and 2.0.0.2 was automatically uninstalled. now it is working fine.

details:

Eduardo-mac:site-packages eduardocerqueira$ sudo pip install ansible==1.9.2  
Password:  
The directory ‘/Users/eduardocerqueira/Library/Caches/pip/http’ or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo’s -H flag.  
The directory ‘/Users/eduardocerqueira/Library/Caches/pip’ or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo’s -H flag.  
Collecting ansible==1.9.2  
Requirement already satisfied (use --upgrade to upgrade): paramiko in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages (from ansible==1.9.2)  
Requirement already satisfied (use --upgrade to upgrade): setuptools in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages (from ansible==1.9.2)  
Requirement already satisfied (use --upgrade to upgrade): PyYAML in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages (from ansible==1.9.2)  
Requirement already satisfied (use --upgrade to upgrade): pycrypto\>=2.6 in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages (from ansible==1.9.2)  
Requirement already satisfied (use --upgrade to upgrade): jinja2 in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages (from ansible==1.9.2)  
Requirement already satisfied (use --upgrade to upgrade): ecdsa\>=0.11 in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages (from paramiko-\>ansible==1.9.2)  
Requirement already satisfied (use --upgrade to upgrade): MarkupSafe in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages (from jinja2-\>ansible==1.9.2)  
Installing collected packages: ansible  
Found existing installation: ansible 2.0.0.2  
Uninstalling ansible-2.0.0.2:  
Successfully uninstalled ansible-2.0.0.2  
Successfully installed ansible-1.9.2  
Eduardo-mac:site-packages eduardocerqueira$ ls -laht |grep ansible  
drwxr-xr-x 22 root admin 748B Jan 29 12:21 ansible  
drwxr-xr-x 9 root admin 306B Jan 29 12:21 ansible-1.9.2.dist-info  
Eduardo-mac:site-packages eduardocerqueira$ ansible --version  
ansible 1.9.2  
configured module search path = None

---

<div class="post-metadata">

**Author:** ![Ajinkya\_Nerkar](https://avatars.discourse-cdn.com/v4/letter/a/dec6dc/32.png) [@Ajinkya\_Nerkar](https://forum.ansible.com/u/Ajinkya_Nerkar)\
**Post date:** [February 16, 2018, 9:54am UTC](https://forum.ansible.com/t/importerror-no-module-named-runner-environment-issues/19148/5 "2018-02-16T09:54:20Z")

</div>

@ayekaymail

> This worked for me

Do  
pip install ansible.runner  
Why delete anything when it can be done by installing something 😉
