Menu
AWS Command Line Interface
User Guide

Install the AWS Command Line Interface on macOS

If you have pip, follow the instructions in the main installation topic. Run pip --version to see if your version of macOS already includes Python and pip.

$ pip --version

If you use the Homebrew package manager, you can install the AWS CLI with the brew command. You can also install Python and pip, and then use pip to install the AWS CLI.

Install the AWS CLI with Homebrew

If you have Homebrew, you can use it to install the AWS CLI. The latest version of the AWS CLI is typically available from Homebrew a couple of days after it appears in pip.

Note

The Homebrew formula for the AWS CLI is not maintained by AWS. If it is not up to date, use pip.

To install the AWS CLI with Homebrew

  1. Run brew install awscli:

    $ brew install awscli
  2. Verify that the AWS CLI is installed correctly:

    $ aws --version
    AWS CLI 1.11.44 (Python 3.4.3)

Install Python, pip, and the AWS CLI on macOS

You can install the latest version of Python and pip and then use them to install the AWS CLI.

To install the AWS CLI on macOS

  1. Download and install Python 3.4 from the downloads page of Python.org.

  2. Install pip with the script provided by the Python Packaging Authority.

    $ curl -O https://bootstrap.pypa.io/get-pip.py
    $ python3 get-pip.py --user
  3. Use pip to install the AWS CLI.

    $ pip3 install --user --upgrade awscli
  4. Add the path to the executable (~/Library/Python/3.4/bin) to your path variable:

    To modify your PATH variable (Linux, macOS, or Unix)

    1. Find your shell's profile script in your user folder. If you are not sure which shell you have, run echo $SHELL.

      $ ls -a ~
      .  ..  .bash_logout  .bash_profile  .bashrc  Desktop  Documents  Downloads
      • Bash.bash_profile, .profile, or .bash_login.

      • Zsh.zshrc

      • Tcsh.tcshrc, .cshrc or .login.

    2. Add an export command to profile script.

      export PATH=~/.local/bin:$PATH

      This command adds a path, ~/.local/bin in this example, to the current PATH variable.

    3. Load the profile into your current session.

      $ source ~/.bash_profile
  5. Verify that the AWS CLI is installed correctly.

    $ aws --version
    AWS CLI 1.11.44 (Python 3.4.3)

To upgrade to the latest version, run the installation command again:

$ pip3 install --user --upgrade awscli

Adding the AWS CLI Executable to your Command Line Path

After installing with pip, add the aws executable to your OS's PATH environment variable.

Example AWS CLI install location - macOS with Python 3.4 and pip (user mode)

~/Library/Python/3.4/bin

To modify your PATH variable (Linux, macOS, or Unix)

  1. Find your shell's profile script in your user folder. If you are not sure which shell you have, run echo $SHELL.

    $ ls -a ~
    .  ..  .bash_logout  .bash_profile  .bashrc  Desktop  Documents  Downloads
    • Bash.bash_profile, .profile, or .bash_login.

    • Zsh.zshrc

    • Tcsh.tcshrc, .cshrc or .login.

  2. Add an export command to profile script.

    export PATH=~/.local/bin:$PATH

    This command adds a path, ~/.local/bin in this example, to the current PATH variable.

  3. Load the profile into your current session.

    $ source ~/.bash_profile