Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Breaking change introduced in python:3.8-slim #944

Closed
alecbw opened this issue Jul 23, 2024 · 9 comments
Closed

Breaking change introduced in python:3.8-slim #944

alecbw opened this issue Jul 23, 2024 · 9 comments

Comments

@alecbw
Copy link

alecbw commented Jul 23, 2024

Hey all,

I have a series of Docker containers running python:3.8-slim that I deploy from my local machine to AWS ECS.

The last successful push was at July 22, 2024, 15:20:36, UTC.

I went to deploy one of the containers this morning - having made exactly 0 changes to the Dockerfile, the docker-compose.yml, the requirements.txt, or any other config file, and it failed out with the following message:

------                                                                                                          
 > [container-name 4/5] RUN pip install pip --upgrade     pip install -r requirements.txt:
#0 2.035 Requirement already satisfied: pip in /usr/local/lib/python3.8/site-packages (23.0.1)                  
#0 2.295 Collecting pip                                                                                         
#0 2.467   Downloading pip-24.1.2-py3-none-any.whl (1.8 MB)
#0 2.701      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.8/1.8 MB 8.1 MB/s eta 0:00:00
#0 2.877 ERROR: Could not find a version that satisfies the requirement install (from versions: none)
#0 2.878 ERROR: No matching distribution found for install
#0 3.135 
#0 3.135 [notice] A new release of pip is available: 23.0.1 -> 24.1.2
#0 3.135 [notice] To update, run: pip install --upgrade pip
------
failed to solve: executor failed running [/bin/sh -c pip install pip --upgrade     pip install -r requirements.txt]: exit code: 1

Here's the entirety of my Dockerfile:

FROM python:3.8-slim

WORKDIR /app

ADD requirements.txt /app

RUN pip install pip --upgrade \
    pip install -r requirements.txt

ADD /folder /app

ARG AWS_ACCOUNT_ID
ENV AWS_ACCOUNT_ID=${AWS_ACCOUNT_ID}
ARG SENTRY_DSN
ENV SENTRY_DSN=${SENTRY_DSN}
ARG MODE
ENV MODE=${MODE}

CMD ["python", "main.py"]

I've tested with python:3.7-slim, and the problem does not replicate.

Removing the pip install pip --upgrade portion removes the error.

I noticed the last push to for python:3.8-slim was an hour ago. The last change to pip was 20 hours ago, before the last successful push I had.

Thoughts?

@wnechtman
Copy link

Having exact same issue with 3.11-slim deploying to Azure ACR

@LaurentGoderre
Copy link
Member

The latest push was from a rebuild due to a change in the underlying image. The last change to 3.8 was 2 weeks ago.

@LaurentGoderre
Copy link
Member

What architecture are you using? amd64 or arm64?

@tianon
Copy link
Member

tianon commented Jul 23, 2024

I'm not able to reproduce:

$ docker run -it --rm --pull=always python:3.8-slim bash
3.8-slim: Pulling from library/python
efc2b5ad9eec: Pull complete 
0d935f02ede5: Pull complete 
fea4f2170757: Pull complete 
e5635d0cdd4c: Pull complete 
ebe530eb534f: Pull complete 
Digest: sha256:48dba4e619b54eef9ef35695e2e2249392345161e0e7f5b21efdbeb6f0dd0df7
Status: Downloaded newer image for python:3.8-slim
root@13d95a4f08f9:/# pip install pip --upgrade
Requirement already satisfied: pip in /usr/local/lib/python3.8/site-packages (23.0.1)
Collecting pip
  Downloading pip-24.1.2-py3-none-any.whl (1.8 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.8/1.8 MB 25.5 MB/s eta 0:00:00
Installing collected packages: pip
  Attempting uninstall: pip
    Found existing installation: pip 23.0.1
    Uninstalling pip-23.0.1:
      Successfully uninstalled pip-23.0.1
Successfully installed pip-24.1.2
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv

Edit: again with 3.11:

$ docker run -it --rm --pull=always python:3.11-slim bash
3.11-slim: Pulling from library/python
efc2b5ad9eec: Already exists 
60462faabbc2: Pull complete 
11f0c4afa075: Pull complete 
d8393bf961f1: Pull complete 
e1558965ee47: Pull complete 
Digest: sha256:ee317183d292ee6ed30e90bc325043ca3f7d2e8c79ac5019575490b5256ae244
Status: Downloaded newer image for python:3.11-slim
root@aabc660d49e2:/# pip install pip --upgrade
Requirement already satisfied: pip in /usr/local/lib/python3.11/site-packages (24.0)
Collecting pip
  Downloading pip-24.1.2-py3-none-any.whl.metadata (3.6 kB)
Downloading pip-24.1.2-py3-none-any.whl (1.8 MB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.8/1.8 MB 11.1 MB/s eta 0:00:00
Installing collected packages: pip
  Attempting uninstall: pip
    Found existing installation: pip 24.0
    Uninstalling pip-24.0:
      Successfully uninstalled pip-24.0
Successfully installed pip-24.1.2
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv

@alecbw
Copy link
Author

alecbw commented Jul 23, 2024

What architecture are you using? amd64 or arm64?

amd64

@wnechtman
Copy link

wnechtman commented Jul 23, 2024

my issue was having ARG PIP="python -m pip install --trusted-host pypi.org" and then running $PIP install
not sure why it just stopped working but removing the double install command fixed it.

@yosifkit
Copy link
Member

Ah, the original post output seems to have the same bug:

RUN pip install pip --upgrade     pip install -r requirements.txt

If that correctly reflects what is in the Dockerfile, then I am surprised it worked before since that is just one pip install command, with 2 pip arguments and an extra install argument. (Not sure why the previous pip ignored the extra install, but now it's trying to find a package by that name: pip install install).

One of these alternatives is probably what you meant:

RUN pip install pip --upgrade && pip install -r requirements.txt
RUN set -e; pip install pip --upgrade; pip install -r requirements.txt

@tianon
Copy link
Member

tianon commented Jul 23, 2024

I bet this is related: 👀

(there used to be an install module on PyPI, but it no longer exists, hence your attempts to install it now failing)

@yosifkit
Copy link
Member

eugenekolo/pip-install#4 -> pypi/support#451 -> pypi/support#451 (comment)

Project install has been removed and added to the Prohibited Project Names list.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants