# Execution Environment from docs doesn't install Python in container

**URL:** <https://forum.ansible.com/t/execution-environment-from-docs-doesnt-install-python-in-container/46272>\
**Category:** Get Help\
**Tags:** venv, wsl2, ansible-navigator, documentation, docker, ubuntu, ee\
**Created:** [September 7, 2026, 8:38pm UTC](https://forum.ansible.com/t/execution-environment-from-docs-doesnt-install-python-in-container/46272 "2026-09-07T20:38:02Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![EmersonPrado](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/emersonprado/32/10437_2.png) [@EmersonPrado](https://forum.ansible.com/u/EmersonPrado)\
**Post date:** [September 7, 2026, 8:38pm UTC](https://forum.ansible.com/t/execution-environment-from-docs-doesnt-install-python-in-container/46272/1 "2026-09-07T20:38:02Z")

</div>

Hi all!

I tried to set up an Execution Environment following the official articles [Setting up your environment](https://docs.ansible.com/projects/ansible/latest/getting_started_ee/setup_environment.html) and [Building your first Execution Environment](https://docs.ansible.com/projects/ansible/latest/getting_started_ee/build_execution_environment.html), but the builder command fails (not all lines shown):

```auto
ansible-builder build --tag postgresql_ee --container-runtime docker
...
 > [base 5/6] RUN /output/scripts/pip_install /usr/bin/python3:
0.169 + PYCMD=/usr/bin/python3
0.169 + '[' -z /usr/bin/python3 ']'
0.169 + '[' '!' -x /usr/bin/python3 ']'
0.169 + echo '/usr/bin/python3 is not an executable'
0.169 + exit 1
0.169 /usr/bin/python3 is not an executable
------
Dockerfile:26
--------------------
  24 | COPY _build/scripts/entrypoint /opt/builder/bin/entrypoint
  25 | RUN $PKGMGR install $PYPKG -y ; if [-z $PKGMGR_PRESERVE_CACHE]; then $PKGMGR clean all; fi
  26 | >>> RUN /output/scripts/pip_install $PYCMD
  27 | RUN $PYCMD -m pip install --no-cache-dir $ANSIBLE_INSTALL_REFS
...

```

I am using a Python virtual environment, from [this official procedure](https://docs.python.org/3.14/library/venv.html#creating-virtual-environments), because my attempt to use Pip failed:

```auto
pip install ansible-navigator
error: externally-managed-environment
...
    If you wish to install a non-Debian-packaged Python package,
    create a virtual environment using python3 -m venv path/to/venv.
...

```

The Dockerfile `context/Dockerfile` installs Python and the Execution Environment file `execution-environment.yml` lists Python as a dependency. But, somehow, the process runs `/output/scripts/pip_install /usr/bin/python3` without Python installed. I also inserted a `rpm -qa | grep python` and a `find / -type f -name 'python*' -exec ls -l '{}' \+` in `pip_install` script, and confirmed there’s no Python in the container.

Questions:

1. What can be going wrong?
2. Is there any log or option to see full output? `ansible-builder` only show last 20 lines of output, so I don’t know if there’s any earlier error.

My setup

- OS: Ubuntu 24.04.2 LTS
- Running on: WSL 2.7.13.0
- Docker version: 29.1.3
- docker-compose version: 1.29.2
- Python venv version: 3.12.3
- Non-privileged user, included in `docker` group

---

<div class="post-metadata">

**Author:** ![EmersonPrado](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/emersonprado/32/10437_2.png) [@EmersonPrado](https://forum.ansible.com/u/EmersonPrado)\
**Post date:** [September 7, 2026, 9:15pm UTC](https://forum.ansible.com/t/execution-environment-from-docs-doesnt-install-python-in-container/46272/2 "2026-09-07T21:15:54Z")

</div>

I installed Podman (version 4.9.3) and ran again, getting some new warnings. Can this lack of multiple capabilities prevent Python installation?

```auto
ansible-builder build --tag postgresql_ee
File context/_build/scripts/pip_install had modifications and will be rewritten
Running command:
  podman build -f context/Containerfile -t postgresql_ee context
...showing last 20 lines of output...
--> 94015b39d9b9
[1/4] STEP 15/16: RUN /output/scripts/pip_install $PYCMD
time="2026-09-07T18:11:23-03:00" level=warning msg="can't raise ambient capability CAP_CHOWN: operation not permitted"
time="2026-09-07T18:11:23-03:00" level=warning msg="can't raise ambient capability CAP_DAC_OVERRIDE: operation not permitted"
time="2026-09-07T18:11:23-03:00" level=warning msg="can't raise ambient capability CAP_FOWNER: operation not permitted"
time="2026-09-07T18:11:23-03:00" level=warning msg="can't raise ambient capability CAP_FSETID: operation not permitted"
time="2026-09-07T18:11:23-03:00" level=warning msg="can't raise ambient capability CAP_KILL: operation not permitted"
time="2026-09-07T18:11:23-03:00" level=warning msg="can't raise ambient capability CAP_NET_BIND_SERVICE: operation not permitted"
time="2026-09-07T18:11:23-03:00" level=warning msg="can't raise ambient capability CAP_SETFCAP: operation not permitted"
time="2026-09-07T18:11:23-03:00" level=warning msg="can't raise ambient capability CAP_SETGID: operation not permitted"
time="2026-09-07T18:11:23-03:00" level=warning msg="can't raise ambient capability CAP_SETPCAP: operation not permitted"
time="2026-09-07T18:11:23-03:00" level=warning msg="can't raise ambient capability CAP_SETUID: operation not permitted"
time="2026-09-07T18:11:23-03:00" level=warning msg="can't raise ambient capability CAP_SYS_CHROOT: operation not permitted"
+ PYCMD=/usr/bin/python3
+ '[' -z /usr/bin/python3 ']'
+ '[' '!' -x /usr/bin/python3 ']'
/usr/bin/python3 is not an executable
+ echo '/usr/bin/python3 is not an executable'
+ exit 1
Error: building at STEP "RUN /output/scripts/pip_install $PYCMD": while running runtime: exit status 1

An error occurred (rc=1), see output line(s) above for details.

```

---

<div class="post-metadata">

**Author:** ![jasonmiller34](https://avatars.discourse-cdn.com/v4/letter/j/45deac/32.png) [@jasonmiller34](https://forum.ansible.com/u/jasonmiller34)\
**Post date:** [September 8, 2026, 7:08am UTC](https://forum.ansible.com/t/execution-environment-from-docs-doesnt-install-python-in-container/46272/3 "2026-09-08T07:08:32Z")

</div>

The host venv shouldn’t affect the EE build—the Python interpreter must be installed inside the base image. I’d first check the generated Dockerfile and confirm that `$PKGMGR install $PYPKG` actually succeeds before `pip_install` runs.

---

<div class="post-metadata">

**Author:** ![johan](https://avatars.discourse-cdn.com/v4/letter/j/dec6dc/32.png) [@johan](https://forum.ansible.com/u/johan)\
**Post date:** [September 8, 2026, 7:16am UTC](https://forum.ansible.com/t/execution-environment-from-docs-doesnt-install-python-in-container/46272/4 "2026-09-08T07:16:06Z")

</div>

Hello,  
my build environment is quite different (rhel / podman), but a few things come to my mind :

- what base image are you using
- ansible-builder build -v3 […] produce much more logs (I usually redirect to a file for problematic cases)
- I found it useful to follow the following instructions to enforce a python version to use (check [Creating execution environment with redhat.satellite collection fails with error [/usr/bin/python3: No module named pip] - Red Hat Customer Portal](https://access.redhat.com/solutions/7116301) ; you might have to create a redhat /developer access, which is free).

---

<div class="post-metadata">

**Author:** ![EmersonPrado](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/emersonprado/32/10437_2.png) [@EmersonPrado](https://forum.ansible.com/u/EmersonPrado)\
**Post date:** [September 8, 2026, 4:52pm UTC](https://forum.ansible.com/t/execution-environment-from-docs-doesnt-install-python-in-container/46272/5 "2026-09-08T16:52:46Z")

</div>

> [@jasonmiller34](#):
>
> I’d first check the generated Dockerfile and confirm that `$PKGMGR install $PYPKG` actually succeeds before `pip_install` runs.

Good. Since `ansible-build` only prints last 20 lines of output, I’ll have to find a way to see this step output. I’ll try to edit the Dockerfile to skip further steps.  
Do you know of a way to see more output?

---

<div class="post-metadata">

**Author:** ![EmersonPrado](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/emersonprado/32/10437_2.png) [@EmersonPrado](https://forum.ansible.com/u/EmersonPrado)\
**Post date:** [September 8, 2026, 4:57pm UTC](https://forum.ansible.com/t/execution-environment-from-docs-doesnt-install-python-in-container/46272/6 "2026-09-08T16:57:02Z")

</div>

> [@johan](#):
>
> - what base image are you using

The docs point to `registry.fedoraproject.org/fedora:42`

> [@johan](#):
>
> - ansible-builder build -v3 […] produce much more logs

Nice. Will try that.

> [@johan](#):
>
> - I found it useful to follow the following instructions to enforce a python version to use

Nice too. The docs point to `python3`, which matches the error messages I could see. I’ll try setting it to 3.12, which is what I have in that station.

---

<div class="post-metadata">

**Author:** ![ildjarn](https://avatars.discourse-cdn.com/v4/letter/i/8491ac/32.png) [@ildjarn](https://forum.ansible.com/u/ildjarn)\
**Post date:** [September 9, 2026, 11:26am UTC](https://forum.ansible.com/t/execution-environment-from-docs-doesnt-install-python-in-container/46272/7 "2026-09-09T11:26:00Z")

</div>

The error is inside the docker container, your local Python environment is completely separate from that. So running ansible\_builder in a venv does not affect how python is running inside the docker container.

Did you accidentally remove the`'python_interpreter: package_system: python3` lines from the execution\_environment.yaml? That step should install python3.

---

<div class="post-metadata">

**Author:** ![EmersonPrado](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/emersonprado/32/10437_2.png) [@EmersonPrado](https://forum.ansible.com/u/EmersonPrado)\
**Post date:** [September 9, 2026, 5:26pm UTC](https://forum.ansible.com/t/execution-environment-from-docs-doesnt-install-python-in-container/46272/8 "2026-09-09T17:26:24Z")

</div>

Thanks, @johan , this did help. I changed the `python_interpreter` settings to python310 and, in one station, it worked. In another one, `dnf` failed repo certificates (output available thanks to `-v3`):

```auto
Failed to download metadata (metalink: "https://mirrors.fedoraproject.org/metalink?repo=updates-released-f42&arch=x86_64") for repository "updates": Cannot prepare internal mirrorlist: Curl error (60): SSL peer certificate or SSH remote key was not OK for https://mirrors.fedoraproject.org/metalink?repo=updates-released-f42&arch=x86_64 [SSL certificate problem: unable to get local issuer certificate]

```

This certificate should be installed in the container image, correct? Should `ansible-builder` update needed certificates before trying to install things via `dnf`, or can it be a problem from the base image itself?

I can’t find a difference between the stations so one works and the other doesn’t. Maybe a different `podman` version, but I can hardly think of how this would change `curl` error…

---

<div class="post-metadata">

**Author:** ![EmersonPrado](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/emersonprado/32/10437_2.png) [@EmersonPrado](https://forum.ansible.com/u/EmersonPrado)\
**Post date:** [September 9, 2026, 5:28pm UTC](https://forum.ansible.com/t/execution-environment-from-docs-doesnt-install-python-in-container/46272/9 "2026-09-09T17:28:18Z")

</div>

No, the first attempts were with `execution_environment.yaml` just copied from instructions. The problem is indeed Python installation failure, but the cause is still obscure.

---

<div class="post-metadata">

**Author:** ![sivel](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/sivel/32/1198_2.png) [@sivel](https://forum.ansible.com/u/sivel)\
**Post date:** [September 9, 2026, 10:41pm UTC](https://forum.ansible.com/t/execution-environment-from-docs-doesnt-install-python-in-container/46272/10 "2026-09-09T22:41:46Z")

</div>

I tried the example and it works fine for me, so nothing outside of those docs should be needed.

Do you have a proxy in your environment? Since the commands run in a container, they wouldn’t inherit any proxy configurations. A proxy is the only common issue I can think of that would cause that curl error, when I’ve verified the instructions work here.

---

<div class="post-metadata">

**Author:** ![EmersonPrado](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/emersonprado/32/10437_2.png) [@EmersonPrado](https://forum.ansible.com/u/EmersonPrado)\
**Post date:** [September 10, 2026, 5:15pm UTC](https://forum.ansible.com/t/execution-environment-from-docs-doesnt-install-python-in-container/46272/11 "2026-09-10T17:15:46Z")

</div>

Hi, @sivel !

> [@sivel](#):
>
> A proxy is the only common issue I can think of that would cause that curl error

Does it mean that a proxy can have its own certificate chain, which should be installed in the container, before running anything internet related?

---

<div class="post-metadata">

**Author:** ![ildjarn](https://avatars.discourse-cdn.com/v4/letter/i/8491ac/32.png) [@ildjarn](https://forum.ansible.com/u/ildjarn)\
**Post date:** [September 11, 2026, 6:45am UTC](https://forum.ansible.com/t/execution-environment-from-docs-doesnt-install-python-in-container/46272/12 "2026-09-11T06:45:48Z")

</div>

What do you get if you browse on your builder machine without proxy?

If there’s a proxy in your environment, see [How to use proxy while creating Execution Environments in disconnected Ansible Automation Platform 2.x setup ? - Red Hat Customer Portal](https://access.redhat.com/solutions/6970431)

```auto
---
version: 3
additional_build_steps:
  prepend_base:
    - RUN pip3 config --global set global.trusted-host "pypi.org files.pythonhosted.org pypi.python.org"
    - RUN pip3 config --user set global.proxy "http://proxy.example.com"
  prepend_builder:
    - ENV http_proxy=proxy.example.com
    - ENV HTTP_PROXY=proxy.example.com
    - ENV https_proxy=proxy.example.com
    - ENV HTTPS_PROXY=proxy.example.com

* To add http/s proxy permanently to the resulted image (not only during the image build) :

additional_build_steps:
  append_final:
    - ENV http_proxy=proxy.example.com
    - ENV HTTP_PROXY=proxy.example.com
    - ENV https_proxy=proxy.example.com
    - ENV HTTPS_PROXY=proxy.example.com

```

---

<div class="post-metadata">

**Author:** ![EmersonPrado](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/emersonprado/32/10437_2.png) [@EmersonPrado](https://forum.ansible.com/u/EmersonPrado)\
**Post date:** [September 14, 2026, 6:27pm UTC](https://forum.ansible.com/t/execution-environment-from-docs-doesnt-install-python-in-container/46272/13 "2026-09-14T18:27:55Z")

</div>

Hi, @ildjarn !

> [@ildjarn](#):
>
> What do you get if you browse on your builder machine without proxy?

It just works.  
I’m testing in 2 different machines: my personal notebook, with direct internet access, and my workstation, with fixed proxy settings - I don’t have permission to change them. I think I got the correct proxy URL and will experiment more.

> [@ildjarn](#):
>
> If there’s a proxy in your environment, see [How to use proxy while creating Execution Environments in disconnected Ansible Automation Platform 2.x setup ? - Red Hat Customer Portal](https://access.redhat.com/solutions/6970431)

I got this:

```auto
/bin/sh: line 1: pip3: command not found

```

Checking the resulting ContainerFile (for the Podman flavour), I see this command ends up before Python installation. I messed around a bit with `execution-environment.yml`, but I really don’t know enough what I’m doing, and just got different errors.  
I’ll start over without the `pip3` commands when I can get back to this machine.

After all, it seems the proxy is indeed the culprit here.
