Welcome, Guest! Registration


Thursday, 2018-03-22
Main » 2016 » September » 8 » ansible ImportError: No module named ansible.errors
10:59 PM
ansible ImportError: No module named ansible.errors

You may be seeing this on your fresh ansible install when executing under your own login:

ansible --version
Traceback (most recent call last):
  File "/usr/bin/ansible", line 39, in <module>
    from ansible.errors import AnsibleError, AnsibleOptionsError, AnsibleParserError
ImportError: No module named ansible.errors

But, it works just fine when you execute it from sudo or root.

The issue is too tight permissions on /usr/lib/python2.6/site-packages/ansible/errors (and probably other modules too) set when you installed ansible using: sudo pip install ansible.

The remedy is to become root with login shell:

sudo su -
pip uninstall ansible
pip install ansible

If that does not help and permissions on /usr/lib/python2.6/site-packages/ansible/errors are still not good, then
a. have a long hard look at umasks,
b. set permissions in whole /usr/lib/python2.6/site-packages/ansible/ to make files and dirs. accessible to everyone, or to at least your group (find . -name/-type -exec is your friend).

Note: Your /usr/lib/python path maybe different depending on your Python version.

Views: 1118 | Added by: ep | Tags: ansible, Linux | Rating: 0.0/0
Total comments: 0
Only registered users can add comments.
[ Registration | Login ]