# install python libs

**URL:** <https://forum.ansible.com/t/install-python-libs/25535>\
**Category:** AWX Project\
**Tags:** awx\
**Created:** [September 19, 2017, 9:04pm UTC](https://forum.ansible.com/t/install-python-libs/25535 "2017-09-19T21:04:52Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mike\_Biancaniello](https://avatars.discourse-cdn.com/v4/letter/m/dec6dc/32.png) [@Mike\_Biancaniello](https://forum.ansible.com/u/Mike_Biancaniello)\
**Post date:** [September 19, 2017, 9:04pm UTC](https://forum.ansible.com/t/install-python-libs/25535/1 "2017-09-19T21:04:52Z")

</div>

I am playing around with AWX and want to load a role (or “project” I suppose is the new term) that has some custom libraries and filter\_plugins. The problem is that these python scripts require py libs that were never installed in the docker image.

Is there a way to configure an additional PYTHONPATH?

I _think_ I should be able to mount a volume (e.g. /opt/custom-python/libs) into the container and install my python there, then make sure that ever custom role adds `sys.path.append(custom_py_path)` before the imports.  
But … I’d prefer to not have to do that.

any ideas?

thanks,

-MikeB

---

<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:** [September 20, 2017, 12:54am UTC](https://forum.ansible.com/t/install-python-libs/25535/2 "2017-09-20T00:54:35Z")

</div>

You could also modify the python requirements files for the image. requirements\_ansible is what controls what gets loaded into the ansible virtualenv for use during playbook runs.

---

<div class="post-metadata">

**Author:** ![Mike\_Biancaniello](https://avatars.discourse-cdn.com/v4/letter/m/dec6dc/32.png) [@Mike\_Biancaniello](https://forum.ansible.com/u/Mike_Biancaniello)\
**Post date:** [September 20, 2017, 1:06pm UTC](https://forum.ansible.com/t/install-python-libs/25535/3 "2017-09-20T13:06:07Z")

</div>

Is the “python requirements file” the list of python packages that are installed when the docker image is created? I’m trying not to have a role change to trigger a manual modification and upgrade of AWX.

I assume you’re talking about the ./requirements/requirements\_ansible.txt file.

---

<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:** [September 20, 2017, 1:33pm UTC](https://forum.ansible.com/t/install-python-libs/25535/4 "2017-09-20T13:33:52Z")

</div>

Yep, the very same

---

<div class="post-metadata">

**Author:** ![Mike\_Biancaniello](https://avatars.discourse-cdn.com/v4/letter/m/dec6dc/32.png) [@Mike\_Biancaniello](https://forum.ansible.com/u/Mike_Biancaniello)\
**Post date:** [September 20, 2017, 3:03pm UTC](https://forum.ansible.com/t/install-python-libs/25535/5 "2017-09-20T15:03:54Z")

</div>

sigh. I’m trying really hard to not have to maintain a local custom branch of awx just to set some of these options.

e.g. if I add a project with a playbook that uses the Juniper.junos module, it won’t work unless I also install junos-eznc, meaning I have to either

1. Modify the container directly: docker exec -it awx\_task /bin/pip install junos-eznc. (which may not actually work – haven’t tried)

or

1. Modify the ./requirements/requirements\_ansible.txt file, then remove my awx\_task container and re-install it.

Unless there’s something I’m missing.

fwiw, even if #1 worked, modifying non-persistent parts of a running container is also something I am trying to avoid.

---

<div class="post-metadata">

**Author:** ![Dave\_Thelen](https://avatars.discourse-cdn.com/v4/letter/d/ac91a4/32.png) [@Dave\_Thelen](https://forum.ansible.com/u/Dave_Thelen)\
**Post date:** [November 7, 2017, 4:27pm UTC](https://forum.ansible.com/t/install-python-libs/25535/6 "2017-11-07T16:27:04Z")

</div>

where does one find the  
/requirements/requirements\_ansible.txt ?

---

<div class="post-metadata">

**Author:** ![Mike\_Biancaniello](https://avatars.discourse-cdn.com/v4/letter/m/dec6dc/32.png) [@Mike\_Biancaniello](https://forum.ansible.com/u/Mike_Biancaniello)\
**Post date:** [November 7, 2017, 4:34pm UTC](https://forum.ansible.com/t/install-python-libs/25535/7 "2017-11-07T16:34:47Z")

</div>

In the root of the repo.  
[https://github.com/ansible/awx/blob/devel/requirements/requirements\_ansible.txt](https://github.com/ansible/awx/blob/devel/requirements/requirements_ansible.txt)
