aws / aws/aws-cli

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

Open
#10,065 3 comments 0 reactions 1 assignee Claimed by @RyanFitzSimmonsAK View on GitHub
bug docker investigating p3
Dominant language
Python
Stars
17.3k
Forks
4.6k
Avg merge
1d 2h
Merged PRs (30d)
13

Description

### 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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.