1

I'm trying to install AWS cli (https://docs.aws.amazon.com/cli/latest/userguide/install-macos.html) in my mac (Big Sur 11.5.2).

When I try I got an error saying python 2.7 is old and I need at least python 3.6. I found that I have two python versions installed:

which python
=> /usr/bin/python

python -V
=> Python 2.7.16

which python3
=> /usr/local/bin/python3
 
python3 --version
=> Python 3.9.6

I have two options: 1- Uninstall python 2.7. But it seems that it is a bad idea (How to uninstall Python 2.7 on a Mac OS X 10.6.4?) 2- Keep both python versions, but how do I make AWS use python 3.9.6 instead of python 2.7?

These are the commands to install AWS cli (https://docs.aws.amazon.com/cli/latest/userguide/install-macos.html):

curl "https://s3.amazonaws.com/aws-cli/awscli-bundle.zip" -o "awscli-bundle.zip"
unzip awscli-bundle.zip
sudo ./awscli-bundle/install -i /usr/local/aws -b /usr/local/bin/aws

After sudo, this is the error:

Unsupported Python version detected: Python 2.7
To continue using this installer you must use Python 3.6 or later.
M.G.
  • 369
  • 1
  • 14
  • 3
    One does not "install AWS" on a Mac. What are you actually trying to do? Use `boto3`? And why cannot you use `python3` binary? – OneCricketeer Aug 24 '21 at 15:23
  • Checkout PyEnv for running multiple versions of python. It may already be installed, especially if Python3 is in `/usr/local` – DaveyBoy Aug 24 '21 at 15:24
  • @OneCricketeer I assume the OP means the AWS command-line client and/or an SDK. – chepner Aug 24 '21 at 15:31
  • 2
    Instead of "python" use "python3". Beyond that, I think you'll need to post the actual error and what you are doing specifically. – Andrew Aug 24 '21 at 15:31
  • @chepner Or could be LocalStack (shrug) – OneCricketeer Aug 24 '21 at 15:34
  • You appear to have installed a version of Python 3 separate from what ships with the OS. However you did that, you can probably install an associated version of `pip3`. Better, though, use a virtual environment, which will use its *own* `python` and `pip` to keep your "working" setup separate from the OS-provided setup. – chepner Aug 24 '21 at 15:35
  • OneCricketeer I'm trying to install AWS cli (https://docs.aws.amazon.com/cli/latest/userguide/install-macos.html). – M.G. Aug 27 '21 at 15:01
  • One solution is to install [miniconda](https://docs.conda.io/en/latest/miniconda.html), add conda-forge to your channels (`conda config --add channels conda-forge`), create a new environment (`conda create -n aws-cli python=3.9 awscli`), then activate the environment (`conda activate aws-cli`). This will install all of the dependencies for the aws-cli toolset and solve your issue with python2.7 compromising the installation. – jared_mamrot Sep 01 '21 at 05:23

1 Answers1

-1

Thank you all for your comments. I was able to fix the issue, I can now install AWS Cli. I did it using alias, pip.

M.G.
  • 369
  • 1
  • 14
  • 2
    Please provide additional details in your answer. As it's currently written, it's hard to understand your solution. – Community Sep 02 '21 at 15:13