ImportError: cannot import name context

382 views
Skip to first unread message

Nabil Boutayeb

unread,
May 21, 2019, 11:06:12 AM5/21/19
to Ansible Project
hello everyone:
weeks ago ansible were working fine,
but today,
trying to execute ansible i got this message:

Traceback (most recent call last):
File "/usr/bin/ansible", line 137, in
from ansible import context
ImportError: cannot import name context



i'm using:

ansible 2.7.8
python version = 2.7.15rc1 (default, Nov 12 2018, 14:31:15) [GCC 7.3.0]

Ubuntu 18.04.2 LTS


I remember doing an update that ask me to accept to change the ansible.cfg and that I refused.


plz help.


cordially


Matt Martz

unread,
May 21, 2019, 11:12:10 AM5/21/19
to ansible...@googlegroups.com
ansible.context is new in Ansible 2.8

You claim you are using ansible 2.7.8

As such, it sounds like you have a mixed/broken installation of Ansible.

--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/f6553dc2-e929-41b1-ab83-501ccacbda12%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--
Matt Martz
@sivel
sivel.net

Nabil Boutayeb

unread,
May 21, 2019, 11:30:56 AM5/21/19
to Ansible Project
many thanks for your answer,
i have to do some staff with it and it's not working,
i uninstalled ansible and install it again, but i still have the same problem
another thing is when i uninstall it, it's removed but i still have the command ??!
cordially

Matt Martz

unread,
May 21, 2019, 11:33:33 AM5/21/19
to ansible...@googlegroups.com
It is possible that you have installed Ansible through 2 different means, such as the OS package manager, and pip.

After uninstalling, make sure that you don't still have the ansible command.  If you do, find it and delete it.  This may require more work than simply removing whatever you did.

--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Nabil Boutayeb

unread,
May 22, 2019, 4:47:44 AM5/22/19
to ansible...@googlegroups.com
many thanks

Cordialement.





P Go green. Consider the environment before printing this email.



Reply all
Reply to author
Forward
0 new messages