ImportError: cannot import name context

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

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.

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

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.

many thanks