Skip to content

Latest update to public.ecr.aws/amazonlinux/amazonlinux:2023 tag appears to break pip?

0

Is anyone running into issues with this tag?

Broken tag? (updated around an hour or so ago) -- corresponds to release version 2023.6.20241209.0

➜ git:(mainline) ✗ docker run -it public.ecr.aws/amazonlinux/amazonlinux:2023 /bin/bash                                                      
bash-5.2# python3 --version
Python 3.9.20
bash-5.2# pip --version
bash: pip: command not found
bash-5.2# python3 -m ensurepip --version
/usr/bin/python3: Error while finding module specification for 'ensurepip.__main__' (ImportError: cannot import name '_bundled' from partially initialized module 'ensurepip' (most likely due to a circular import) (/usr/lib64/python3.9/ensurepip/__init__.py))

Tag that still works (what we were pointing earlier today)

➜ git:(mainline) ✗ docker pull public.ecr.aws/amazonlinux/amazonlinux:2023.6.20241121.0                                                         <...> 
➜ git:(mainline) ✗ docker run -it public.ecr.aws/amazonlinux/amazonlinux:2023.6.20241121.0 /bin/bash 
bash-5.2# python3 -m ensurepip --version
pip 21.3.1

It appears that the updates to the 2023 3tag may have broken something with pip / ensurepip, because pip is no longer installed and ensurepip can not be run.

Note: This is running purely on a container running from these base images (see paste)

As a result, builds of our image are failing because we can't run pip or start up our venv within the Dockerfile.

asked a year ago218 views
2 Answers
2

Hello,

On my side the command python3 -m ensurepip --version returns correctly the version. But indeed, pip is not installed by default, you can install it with the command yum install python3-pip if needed.

[root@ip-X-X-X-X ec2-user]# docker run -it public.ecr.aws/amazonlinux/amazonlinux:2023 /bin/bash
bash-5.2# python3 --version
Python 3.9.16
bash-5.2# python3 -m ensurepip --version
pip 21.3.1
EXPERT
answered a year ago
0
Accepted Answer

It looks like they fixed the issue in an update a few hours after my original post:

Got this message back from support:

I have confirmed that the issue is also present on the latest AL2023 AMIs (2023.6.20241209.0) and isn't isolated to the AL2023 container images available in ECR: python3 -m ensurepip /usr/bin/python3: Error while finding module specification for 'ensurepip.main' (ImportError: cannot import name '_bundled' from partially initialized module 'ensurepip' (most likely due to a circular import) (/usr/lib64/python3.9/ensurepip/init.py))

An internal ticket has been created with the internal AL2023 team for them to investigate and remediate this problem. I will keep you updated around this and let you know as soon as I have more information. In the meantime, please use the 2023.6.20241121.0 AL2023 container image where ensurepip is working as expected.

My apologies for the disruption this has caused. I will keep you updated. If you have any further questions or issues around this, please don't hesitate to reach out and I will be glad to assist further. All the best.

It does look fixed now

answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.