aws-cli icon indicating copy to clipboard operation
aws-cli copied to clipboard

Error installing from source when using python 3.12

Open marboledacci opened this issue 1 year ago • 0 comments

Describe the bug

I'm following the steps in this guide to install the cli on MacOS as we didn't want to depend on brew. It works well in most scenarios, but it fails when using python 3.12. After running make, the following error happens:

AttributeError: module 'pkgutil' has no attribute 'ImpImporter'. Did you mean: 'zipimporter'?

This happens when make is installing ruamel-yaml-clib==0.2.7. I tried manually installing version 0.2.8, and the installation works, but when running make, it will try again to install the 0.2.7 and fail.

Expected Behavior

The make command configure to install dependencies should install aws cli when using python 3.12, as that shows as a supported version.

Current Behavior

The make command is failing to install dependencies as ImpImporter is required in one of them, and it is removed on python 3.12.

Reproduction Steps

I'm running this commands when trying to install:

curl -o awscli.tar.gz "https://awscli.amazonaws.com/awscli$version.tar.gz"

mkdir awscli

tar -xzf awscli.tar.gz -C awscli --strip-components=1

cd awscli

./configure --with-download-deps

make

The make command fails when installing dependencies if python 3.12 is used. I tested in MacOS and Ubuntu, it happens for both.

Possible Solution

Updating the version for ruamel-yaml-clib==0.2.7 could fix this issues, as that seems to be the problem, but may be other libraries have the same problem with ImpImporter in python 3.12 and need to be updated.

Additional Information/Context

I need to install the cli like this because the pkg package doesn't work on Apple Silicon, and I want to avoid Brew and Rosetta as dependencies.

CLI version used

latest

Environment details (OS name and version, etc.)

Ubuntu and MacOS with Python 3.12 installed.

marboledacci avatar Aug 21 '24 17:08 marboledacci