Run Ansible on SUSE linux throws ImportError cannot import name context error

0 votes

On 'SUSE Linux Enterprise Server 12 SP5' server, i have installed Ansible (2.8.2 version) as root user. 

When i run 'ansible --version', i get this output.

 $ansible --version
ansible 2.8.2
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3.6/site-packages/ansible
  executable location = /usr/bin/ansible
  python version = 3.6.15 (default, Sep 15 2021, 14:20:42) [GCC]

The same cmd, when i run as non-root user, i get this error.
$ ansible --version
Traceback (most recent call last):
  File "/usr/bin/ansible", line 32, in <module>
    from ansible import context
ImportError: cannot import name 'context'

Please let me know how to resolve this error.

Aug 4, 2022 in Others by Saravanan

edited Mar 4, 2025 373 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP