kylejw2
kylejw2

Reputation: 489

AWS CLI not working because of unsupported Python version

I'm trying to download the AWS CLI tools onto my mac. The error message is pretty clear Unsupported Python version detected: Python 2.7 To continue using this installer you must use Python 3.6 or later. The issue I'm having is that aliasing python to python3 isn't working. For some reason, after aliasing, the installer still references Python 2.7.

After aliasing through the cli didn't work for installing AWS CLI, I added alias python=python3 to my .zshrc file. Running python --version returns Python 3.9.6. Running the AWS installer still references the older version of python.

I'm hesitant to completely override the older version, because I've read from multiple sources that the default python on OS X should not be touched.

Can someone explain how I can reference the newer version of python when installing the AWS CLI tools?

Upvotes: 5

Views: 15857

Answers (2)

linonymous
linonymous

Reputation: 141

while installation, choosing python3 worked well for me. Choose the "To install the AWS CLI version using the bundled installer" from here: https://docs.aws.amazon.com/cli/v1/userguide/install-macos.html

sudo /usr/local/bin/python3 awscli-bundle/install -i /usr/local/aws -b /usr/local/bin/aws

Replace /usr/local/bin/python3 with the path to your python binary with version >= 3.6.

Upvotes: 10

kylejw2
kylejw2

Reputation: 489

My problem was that I was trying to download an old version of the awscli. After downloading the newest version I ran into some issues with the credentials file. Upon updating the credentials file and adding a config file in the .aws directory, everything worked as expected.

Upvotes: 2

Related Questions