One possible way to set up AWS CLI on macOS Sierra to utilize Python3.x instead of the default Python2.7 is to use a virtual environment with Python3.x and install AWS CLI within that environment. Here are the steps:
Install Python3.x if it is not already installed on your system. You can download the installer package from the official Python website (https://www.python.org/downloads/).
Install virtualenv using pip, the package installer for Python:
pip install virtualenv
Create a new virtual environment with Python3.x:
virtualenv -p $(which python3) awscli-env
Activate the virtual environment:
source awscli-env/bin/activate
Install AWS CLI within the virtual environment using pip:
pip install awscli
Test the installation by running a command such as:
aws --version
This should display the version of AWS CLI installed within the virtual environment. To exit the virtual environment, simply run the command:
deactivate
Note: These steps assume that you already have Python3.x and pip installed on your system. If you do not have them installed, you can install them using Homebrew or another package manager for macOS.
Asked: 2022-11-26 11:00:00 +0000
Seen: 7 times
Last updated: Jun 19 '22