# import context ImportError: No module named context

**URL:** <https://forum.ansible.com/t/import-context-importerror-no-module-named-context/33518>\
**Category:** AWX Project\
**Tags:** windows, awx\
**Created:** [July 29, 2020, 10:18am UTC](https://forum.ansible.com/t/import-context-importerror-no-module-named-context/33518 "2020-07-29T10:18:27Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jean\_G](https://avatars.discourse-cdn.com/v4/letter/j/ccd318/32.png) [@Jean\_G](https://forum.ansible.com/u/Jean_G)\
**Post date:** [July 29, 2020, 10:18am UTC](https://forum.ansible.com/t/import-context-importerror-no-module-named-context/33518/1 "2020-07-29T10:18:27Z")

</div>

Hello,

I’m using AWX for Windows automation in my personal lab.  
I use WinRM protocol with a certificate connection to reach my different VMs.

Software versions :

- Ansible : 2.9.10
- AWX : 2.1.2

I’ve tried to use dynamic inventories but i’m facing a problem with the Python module named “context” even if this module is physically present on the OS.

Did you already encountered this issue ? Thanks in advance for your help.

The error detail on AWX web interface is :

2.980 INFO Updating inventory 6: Dyn - INV - test

2  
2.997 INFO Reading Ansible inventory source: /tmp/awx\_127\_9pMQHg/tmpXl9zaa

3  
Traceback (most recent call last):

4  
File “/opt/awx/bin/awx-manage”, line 11, in

5  
sys.exit(manage())

6  
File “/opt/awx/embedded/lib/python2.7/site-packages/awx/ **init**.py”, line 150, in manage

7  
execute\_from\_command\_line(sys.argv)

8  
File “/opt/awx/embedded/lib64/python2.7/site-packages/django/core/management/ **init**.py”, line 364, in execute\_from\_command\_line

9  
utility.execute()

10  
File “/opt/awx/embedded/lib64/python2.7/site-packages/django/core/management/ **init**.py”, line 356, in execute

11  
self.fetch\_command(subcommand).run\_from\_argv(self.argv)

12  
File “/opt/awx/embedded/lib64/python2.7/site-packages/django/core/management/base.py”, line 283, in run\_from\_argv

13  
self.execute(\*args, \*\*cmd\_options)

14  
File “/opt/awx/embedded/lib64/python2.7/site-packages/django/core/management/base.py”, line 330, in execute

15  
output = self.handle(\*args, \*\*options)

16  
File “/opt/awx/embedded/lib/python2.7/site-packages/awx/main/management/commands/inventory\_import.py”, line 994, in handle

17  
self.is\_custom)

18  
File “/opt/awx/embedded/lib/python2.7/site-packages/awx/main/management/commands/inventory\_import.py”, line 245, in load\_inventory\_source

19  
is\_custom=is\_custom).load()

20  
File “/opt/awx/embedded/lib/python2.7/site-packages/awx/main/management/commands/inventory\_import.py”, line 180, in load

21  
data = self.command\_to\_json(base\_args + [‘–list’])

22  
File “/opt/awx/embedded/lib/python2.7/site-packages/awx/main/management/commands/inventory\_import.py”, line 163, in command\_to\_json

23  
self.method, proc.returncode, stdout, stderr))

24  
RuntimeError: ansible-inventory failed (rc=1) with stdout:

26  
stderr:

27  
[WARNING]: \* Failed to parse /tmp/awx\_127\_9pMQHg/tmpXl9zaa with script plugin:

28  
Inventory script (/tmp/awx\_127\_9pMQHg/tmpXl9zaa) had an execution error:

29  
Traceback (most recent call last): File “/tmp/awx\_127\_9pMQHg/tmpXl9zaa”, line

30  
7, in import context ImportError: No module named context

31  
[WARNING]: Unable to parse /tmp/awx\_127\_9pMQHg/tmpXl9zaa as an inventory source

32  
ERROR! No inventory was parsed, please check your configuration and options.
