Ask Your Question
2

How can AWS CLI on macOS Sierra be set up to utilize Python3.x instead of the default Python2.7 in the operating system?

asked 2022-11-26 11:00:00 +0000

huitzilopochtli gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2022-06-19 21:00:00 +0000

bukephalos gravatar image

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:

  1. 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/).

  2. Install virtualenv using pip, the package installer for Python:

    pip install virtualenv
    
  3. Create a new virtual environment with Python3.x:

    virtualenv -p $(which python3) awscli-env
    
  4. Activate the virtual environment:

    source awscli-env/bin/activate
    
  5. Install AWS CLI within the virtual environment using pip:

    pip install awscli
    
  6. 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.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2022-11-26 11:00:00 +0000

Seen: 7 times

Last updated: Jun 19 '22