Skip to content

Alpine docker: PyInstaller/loader/pyimod02_importers.py:384: UserWarning: pkg_resources is deprecated as an API. #10065

@jgournet

Description

@jgournet

Describe the bug

Our current build process for AWS CLI v2 on docker alpine results in this warning message when using aws cli:

/aws-cli-bin/aws --version

PyInstaller/loader/pyimod02_importers.py:384: UserWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html. The pkg_resources package is slated for removal as early as 2025-11-30. Refrain from using this package or pin to Setuptools<81.

Regression Issue

  • Select this option if this issue appears to be a regression.

Expected Behavior

No warning message

Current Behavior

/aws-cli-bin/aws --version

PyInstaller/loader/pyimod02_importers.py:384: UserWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html. The pkg_resources package is slated for removal as early as 2025-11-30. Refrain from using this package or pin to Setuptools<81.

Reproduction Steps

Our Alpine Dockerfile:

FROM alpine:latest

WORKDIR /aws-cli-sourcecode

RUN apk upgrade --no-cache && \
    apk add --update --no-cache bash ca-certificates musl-dev curl jq htop groff build-base libffi-dev cmake git && \
    apk add python3-dev python3 && \
    git clone --recursive  --depth 1 --branch v2 --single-branch  https://github.com/aws/aws-cli.git /aws-cli-sourcecode

RUN python -m venv venv && \
    . venv/bin/activate && \
    python3 -m ensurepip && \
    ln -s /usr/bin/pip3 /usr/bin/pip && \
    pip install setuptools && \
    scripts/installers/make-exe && \
    unzip -q dist/awscli-exe.zip && \
    aws/install --bin-dir /aws-cli-bin && \
    /aws-cli-bin/aws --version

Possible Solution

I tried using pip to install aws cli on alpine, but we get version aws-cli/1.44.35

Additional Information/Context

No response

CLI version used

v2

Environment details (OS name and version, etc.)

alpine docker latest

Metadata

Metadata

Labels

bugThis issue is a bug.dockerIssue involves the AWS CLI Docker container imageinvestigatingThis issue is being investigated and/or work is in progress to resolve the issue.p3This is a minor priority issue

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions