# Missing python library

**URL:** <https://forum.ansible.com/t/missing-python-library/25959>\
**Category:** AWX Project\
**Tags:** awx\
**Created:** [November 8, 2017, 3:15pm UTC](https://forum.ansible.com/t/missing-python-library/25959 "2017-11-08T15:15:36Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Marc\_Herren](https://avatars.discourse-cdn.com/v4/letter/m/5f8ce5/32.png) [@Marc\_Herren](https://forum.ansible.com/u/Marc_Herren)\
**Post date:** [November 8, 2017, 3:15pm UTC](https://forum.ansible.com/t/missing-python-library/25959/1 "2017-11-08T15:15:36Z")

</div>

Hi,

My playbook uses lookup with dig, which needs the dnspython library. [1]

I’ve installed the library on the system with pip and cli ansible-playbook execution just works as expected.

Unfortunately with AWX it fails:

FAILED! =\> {“failed”: true, “msg”: “An unhandled exception occurred while running the lookup plugin ‘dig’. Error was a \<class ‘ansible.errors.AnsibleError’\>, original message: The dig lookup requires the python ‘dnspython’ library and it is not installed”}

Not sure if this is related to Bubblewrap and how to include the missing library.

Any hints?

Marc

[1] [http://docs.ansible.com/ansible/latest/playbooks\_lookups.html#the-dns-lookup-dig](http://docs.ansible.com/ansible/latest/playbooks_lookups.html#the-dns-lookup-dig)

---

<div class="post-metadata">

**Author:** ![Marc\_Herren](https://avatars.discourse-cdn.com/v4/letter/m/5f8ce5/32.png) [@Marc\_Herren](https://forum.ansible.com/u/Marc_Herren)\
**Post date:** [November 8, 2017, 3:27pm UTC](https://forum.ansible.com/t/missing-python-library/25959/2 "2017-11-08T15:27:02Z")

</div>

Hmm, ok… seems that I need to modify requirements/requirements\_ansible.txt and then rebuild everything?

or can I add it as a request to be added to the prebuild docker images?

---

<div class="post-metadata">

**Author:** ![Robin\_Miller](https://avatars.discourse-cdn.com/v4/letter/r/8edcca/32.png) [@Robin\_Miller](https://forum.ansible.com/u/Robin_Miller)\
**Post date:** [November 9, 2017, 1:08pm UTC](https://forum.ansible.com/t/missing-python-library/25959/3 "2017-11-09T13:08:45Z")

</div>

Was in a similar situation as you. I found that modifying the requirements.txt was a bit complicated because they contain specific dependency versions, and I didn’t want to get into rebuilding them. Instead I modified the Dockerfile for the task container to include what I needed, which is working for me for now.

I doubt the project is going to include anything like that in the official images since every users needs will vary.

---

<div class="post-metadata">

**Author:** ![Marc\_Herren](https://avatars.discourse-cdn.com/v4/letter/m/5f8ce5/32.png) [@Marc\_Herren](https://forum.ansible.com/u/Marc_Herren)\
**Post date:** [November 9, 2017, 3:25pm UTC](https://forum.ansible.com/t/missing-python-library/25959/4 "2017-11-09T15:25:31Z")

</div>

Could you tell me where exaclty you did it?

Currently I simply install dnssearch within the container and set a reminder that if I would update it, i would need to reinstallt it 😉

---

<div class="post-metadata">

**Author:** ![Cody\_John](https://avatars.discourse-cdn.com/v4/letter/c/8e7dd6/32.png) [@Cody\_John](https://forum.ansible.com/u/Cody_John)\
**Post date:** [November 9, 2017, 5:44pm UTC](https://forum.ansible.com/t/missing-python-library/25959/5 "2017-11-09T17:44:33Z")

</div>

For now I’m doing the same thing: I just keep a list of packages I need to pip install every time I rev the awx\_task container. I do so infrequently enough that it’s just easier to do that than build my own images or mess with the installer.
