# Error in AWX -- import pymssql\\ImportError: No module named pymssql

**URL:** <https://forum.ansible.com/t/error-in-awx-import-pymssql-importerror-no-module-named-pymssql/28962>\
**Category:** AWX Project\
**Tags:** awx\
**Created:** [November 6, 2018, 10:53pm UTC](https://forum.ansible.com/t/error-in-awx-import-pymssql-importerror-no-module-named-pymssql/28962 "2018-11-06T22:53:28Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Robson\_Gomes](https://avatars.discourse-cdn.com/v4/letter/r/3be4f8/32.png) [@Robson\_Gomes](https://forum.ansible.com/u/Robson_Gomes)\
**Post date:** [November 6, 2018, 10:53pm UTC](https://forum.ansible.com/t/error-in-awx-import-pymssql-importerror-no-module-named-pymssql/28962/1 "2018-11-06T22:53:28Z")

</div>

In AWX when trying to run a playbook that locally runs a python script the following error appears:

import pymssql\ImportError: No module named pymssql

however, via the command line the playbook works normally.

the python script imports some modules:

cat my\_script.py

#!/usr/bin/python  
import sys  
import pymssql

…

the playbook makes a call in the python script

cat playbook.yml

---

<div class="post-metadata">

**Author:** ![Robson\_Gomes](https://avatars.discourse-cdn.com/v4/letter/r/3be4f8/32.png) [@Robson\_Gomes](https://forum.ansible.com/u/Robson_Gomes)\
**Post date:** [November 6, 2018, 11:05pm UTC](https://forum.ansible.com/t/error-in-awx-import-pymssql-importerror-no-module-named-pymssql/28962/2 "2018-11-06T23:05:09Z")

</div>

> stdout of awx

> **(attachments)**
>
> ![stdout.PNG](https://us1.discourse-cdn.com/ansible/original/2X/f/f490a3f52845edb02527aed85a9afe42292d581b.png)

---

<div class="post-metadata">

**Author:** ![matburt](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/matburt/32/3612_2.png) [@matburt](https://forum.ansible.com/u/matburt)\
**Post date:** [November 6, 2018, 11:30pm UTC](https://forum.ansible.com/t/error-in-awx-import-pymssql-importerror-no-module-named-pymssql/28962/3 "2018-11-06T23:30:43Z")

</div>

I’m not sure why you’d try installing them in the rabbitmq container… they’ll need to be the awx\_task container.

---

<div class="post-metadata">

**Author:** ![Robson\_Gomes](https://avatars.discourse-cdn.com/v4/letter/r/3be4f8/32.png) [@Robson\_Gomes](https://forum.ansible.com/u/Robson_Gomes)\
**Post date:** [November 6, 2018, 11:52pm UTC](https://forum.ansible.com/t/error-in-awx-import-pymssql-importerror-no-module-named-pymssql/28962/4 "2018-11-06T23:52:29Z")

</div>

thanks for the help, I installed the pip and the two python modules that needed and worked:

#docker cp get-pip.py awx\_task:/get-pip.py  
#docker exec -it xxxxxxxxxx bash

#python get-pip.py  
#pip install Pyvmoni  
#pip install pymssql

would you know which file docker file (if any) I can add these settings to this container in a new installation?

---

<div class="post-metadata">

**Author:** ![matburt](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/matburt/32/3612_2.png) [@matburt](https://forum.ansible.com/u/matburt)\
**Post date:** [November 7, 2018, 1:18am UTC](https://forum.ansible.com/t/error-in-awx-import-pymssql-importerror-no-module-named-pymssql/28962/5 "2018-11-07T01:18:07Z")

</div>

This is the file you want to modify: [https://github.com/ansible/awx/blob/devel/installer/roles/image\_build/templates/Dockerfile.task.j2](https://github.com/ansible/awx/blob/devel/installer/roles/image_build/templates/Dockerfile.task.j2)

Follow the instructions in the installer and inventory file to build your own image from it.
