This documentation is for Version 1 of the AWS CLI only. For documentation related to Version 2 of the AWS CLI, see the Version 2 User Guide.
Installing, updating, and uninstalling the AWS CLI version 1 on macOS
You can install the AWS Command Line Interface (AWS CLI) version 1 and its dependencies on macOS by using the
bundled installer or pip.
Sections
Prerequisites
Before you can install the AWS CLI version 1 on macOS, be sure you have Python 3.8 or later
installed. For installation instructions, see the Downloading
Python
Python version support matrix
| AWS CLI version | Supported Python version |
|---|---|
| 1.39.0 – current | Python 3.9+ |
| 1.32.0 – 1.38.38 | Python 3.8+ |
| 1.27.0 – 1.31.x | Python 3.7+ |
| 1.20.0 – 1.26.x | Python 3.6+ |
| 1.19.0 – 1.19.x | Python 2.7+, Python 3.6+ |
| 1.17 – 1.18.x | Python 2.7+, Python 3.4+ |
| 1.0 – 1.16.x | Python 2.6 and older, Python 3.3 and older |
Install, update and uninstall the AWS CLI version 1 on macOS using the bundled installer
On Linux or macOS, you can use the bundled installer to install version 1 of the AWS Command Line Interface (AWS CLI). The bundled installer includes all dependencies and can be used offline.
The bundled installer doesn't support installing to paths that contain spaces.
Topics
Install the AWS CLI version 1 using the bundled
installer with sudo
The following steps enable you to install the AWS CLI version 1 from the command line on any build of macOS.
The following is a summary of the installation commands that you can cut and paste to run as a single set of commands.
For the latest version of the AWS CLI, use the following command block:
$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
For a specific version of the AWS CLI, append a
hyphen and the version number to the filename. For this example the filename for
version 1.16.312 would be
awscli-bundle-1.16.312.zip resulting in the following
command:
$curl "https://s3.amazonaws.com/aws-cli/awscli-bundle-1.16.312.zip" -o "awscli-bundle.zip" unzip awscli-bundle.zip sudo ./awscli-bundle/install -i /usr/local/aws -b /usr/local/bin/aws
To install the AWS CLI version 1 using the bundled installer
-
Download the AWS CLI version 1 bundled installer in one of the following ways:
-
Download using the
curlcommand.For the latest version of the AWS CLI, use the following command block:
$curl "https://s3.amazonaws.com/aws-cli/awscli-bundle.zip" -o "awscli-bundle.zip"For a specific version of the AWS CLI, append a hyphen and the version number to the filename. For this example the filename for version
1.16.312would beawscli-bundle-1.16.312.zipresulting in the following command:$curl "https://s3.amazonaws.com/aws-cli/awscli-bundle-1.16.312.zip" -o "awscli-bundle.zip" -
Download using the direct link.
For the latest version of the AWS CLI: https://s3.amazonaws.com/aws-cli/awscli-bundle.zip
For a specific version of the AWS CLI, append a hyphen and the version number to the filename. For this example the filename for version
1.16.312would beawscli-bundle-1.16.312.zipresulting in the following url https://s3.amazonaws.com/aws-cli/awscli-bundle-1.16.312.zip
-
-
Extract (unzip) the files from the package. If you don't have
unzip, use your macOs distribution's built-in package manager to install it.$unzip awscli-bundle.zip -
Run the install program. The installer installs the AWS CLI at
/usr/local/awsand creates the symlinkawsat the/usr/local/binfolder. Using the-boption to create a symlink eliminates the need to specify the install folder in the user's$PATHvariable. This should enable all users to call the AWS CLI by enteringawsfrom any directory.$sudo ./awscli-bundle/install -i /usr/local/aws -b /usr/local/bin/awsBy default, the install script runs under the system default version of Python. If you have installed an alternative version of Python and want to use that to install the AWS CLI, run the install script with that version by absolute path to the Python executable, as follows.
$sudo/usr/local/bin/python3.7awscli-bundle/install -i /usr/local/aws -b /usr/local/bin/aws -
Verify that the AWS CLI installed correctly.
$aws --versionaws-cli/1.40.41 Python/3.11.6 Linux/5.10.205-195.807.amzn2.x86_64 botocore/1.18.6If you get an error, see Troubleshooting errors for the AWS CLI.
Install the AWS CLI version 1 using the
bundled installer without sudo
If you don't have sudo permissions or want to install the AWS CLI only
for the current user, you can use a modified version of the previous commands. The
first two commands are the same.
For the latest version of the AWS CLI, use the following command block:
$curl "https://s3.amazonaws.com/aws-cli/awscli-bundle.zip" -o "awscli-bundle.zip" unzip awscli-bundle.zip ./awscli-bundle/install -b ~/bin/aws
For a specific version of the AWS CLI, append a
hyphen and the version number to the filename. For this example the filename for
version 1.16.312 would be
awscli-bundle-1.16.312.zip resulting in the following
command:
$curl "https://s3.amazonaws.com/aws-cli/awscli-bundle-1.16.312.zip" -o "awscli-bundle.zip" unzip awscli-bundle.zip ./awscli-bundle/install -b ~/bin/aws
To install the AWS CLI version 1 for the current user
-
Download the AWS CLI version 1 bundled installer using one of the the following methods:
-
Download using the
curlcommand.For the latest version of the AWS CLI, use the following command block:
$curl "https://s3.amazonaws.com/aws-cli/awscli-bundle.zip" -o "awscli-bundle.zip"For a specific version of the AWS CLI, append a hyphen and the version number to the filename. For this example the filename for version
1.16.312would beawscli-bundle-1.16.312.zipresulting in the following command:$curl "https://s3.amazonaws.com/aws-cli/awscli-bundle-1.16.312.zip" -o "awscli-bundle.zip" -
Download using the direct link.
For the latest version of the AWS CLI: https://s3.amazonaws.com/aws-cli/awscli-bundle.zip
For a specific version of the AWS CLI, append a hyphen and the version number to the filename. For this example the filename for version
1.16.312would beresulting in the following url https://s3.amazonaws.com/aws-cli/awscli-bundle-1.16.312.zipawscli-bundle-1.16.312.zip
-
-
Extract the files from the package. If you don't have
unzip, use your Linux distribution's built-in package manager to install it.$unzip awscli-bundle.zip -
Run the install program. The installer installs the AWS CLI at
/usr/local/awsand creates the symlinkawsat the/usr/local/bindirectory. The command uses the-bparameter to specify the directory where the installer places theawssymlink file. You must have write permissions to the specified directory.$./awscli-bundle/install -b ~/bin/awsThis installs the AWS CLI to the default location (
~/.local/lib/aws) and creates a symbolic link (symlink) at~/bin/aws. Make sure that~/binis in your$PATHenvironment variable for the symlink to work.$echo $PATH | grep ~/bin// See if $PATH contains ~/bin (output will be empty if it doesn't)$export PATH=~/bin:$PATH// Add ~/bin to $PATH if necessary -
Ensure the folder that the AWS CLI version 1 is installed in is part of your
$PATHvariable.-
Find your shell's profile script in your user folder. If you're 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,.cshrcor.login
-
-
Add an export command at the end of your profile script that's similar to the following example.
export PATH=~/.local/bin:$PATHThis command inserts the path,
~/.local/binin this example, at the front of the existingPATHvariable. -
Reload the profile into your current session to put those changes into effect.
$source ~/.bash_profile
-
-
Verify that the AWS CLI installed correctly.
$aws --versionaws-cli/1.40.41 Python/3.11.6 Linux/5.10.205-195.807.amzn2.x86_64 botocore/1.18.6If you get an error, see Troubleshooting errors for the AWS CLI.
Uninstall the AWS CLI version 1 bundled installer
-
The bundled installer puts everything inside of the installation directory except the optional symlink, so to uninstall, you just need to delete those two items.
$sudo rm -rf /usr/local/aws$sudo rm /usr/local/bin/aws -
(Optional) Remove the shared AWS SDK and AWS CLI settings information in the
.awsfolder.Warning
These configuration and credentials settings are shared across all AWS SDKs and the AWS CLI. If you remove this folder, they cannot be accessed by any AWS SDKs that are still on your system.
The default location of the
.awsfolder differs between platforms, by default the folder is located in~/.aws/. If your user has write permission to this directory, you don't need to usesudo.$sudo rm~/.aws/
Install, update and uninstall the AWS CLI version 1 using pip
You can use pip directly to install the AWS CLI.
Topics
Install pip
If you don't already have pip installed, you can install it by using
the script that the Python Packaging Authority
provides. Run pip --version to see if your version of Linux already
includes Python and pip. We recommend that if you have Python version 3
or later installed, you use the pip3 command.
-
Use the
curlcommand to download the installation script. The following command uses the-O(uppercase "O") parameter to specify that the downloaded file is to be stored in the current folder using the same name it has on the remote host.$curl -O https://bootstrap.pypa.io/get-pip.py -
Run the script with the
pythonorpython3command to download and install the latest version ofpipand other required support packages. When you include the--userswitch, the script installspipto the path~/.local/bin.$python3 get-pip.py --user
Install and update the AWS CLI using pip
-
Use the
piporpip3command to install the AWS CLI. We recommend that if you use Python version 3 or later, that you use thepip3command.For the latest version of the AWS CLI, use the following command block:
$pip3 install awscli --upgrade --userFor a specific version of the AWS CLI, append two equals signs
=and the version number to the filename. For this example the filename for version1.16.312would be==1.16.312resulting in the following command:$pip3 install awscli==1.16.312--upgrade --userNote
Use appropriate quoting rules for your terminal. To use the
=character, you might need to use single or double quotes to escape properly. The following example escapes using single quotes:$pip3 install 'awscli==1.16.312' --upgrade --user -
Verify that the AWS CLI is installed correctly.
$aws --versionaws-cli/1.40.41 Python/3.11.6 Darwin/23.3.0 botocore/1.18.6If the program isn't found, add it to your command line path.
Add the AWS CLI version 1 executable to your macOS command line path
After installing with pip, you might need to add the aws
program to your operating system's PATH environment variable. The
location of the program depends on where Python is installed.
Example AWS CLI install location - macOS with Python 3.6 and pip (user
mode)
~/Library/Python/3.7/bin
Substitute the version of Python that you have for the version in the previous example.
If you don't know where Python is installed, run which python.
$which python/usr/local/bin/python
The output might be the path to a symlink, not the actual program. Run ls
-al to see where it points.
$ls -al /usr/local/bin/python~/Library/Python/3.7/bin/python3.7
pip installs programs in the same folder that contains the Python
application. Add this folder to your PATH variable.
To modify your PATH variable
-
Find your shell's profile script in your user directory. If you're 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
-
-
Add an export command to your profile script.
export PATH=~/.local/bin:$PATHThis command adds a path,
~/.local/binin this example, to the currentPATHvariable. -
Load the updated profile into your current session.
$source ~/.bash_profile
Uninstall the AWS CLI using pip
-
If you installed the AWS CLI version 1 using
pip, you must also uninstall usingpip.$pip uninstall awscliIf you are using version Python 2 or 3, you might need to use the
pip2orpip3command. Use theaws --versioncommand to determine the Python version associated with your installed AWS CLI version 1.$pip3 uninstall awscliYou might need to restart your command prompt window or your computer to remove all files.
-
(Optional) Remove the shared AWS SDK and AWS CLI settings information in the
.awsfolder.Warning
These configuration and credentials settings are shared across all AWS SDKs and the AWS CLI. If you remove this folder, they cannot be accessed by any AWS SDKs that are still on your system.
The default location of the
.awsfolder differs between platforms, by default the folder is located in~/.aws/. If your user has write permission to this directory, you don't need to usesudo.$sudo rm -rf~/.aws/
Troubleshooting AWS CLI install and uninstall errors
If you come across issues after installing or uninstalling the AWS CLI, see Troubleshooting errors for the AWS CLI for troubleshooting steps. For the most relevant troubleshooting steps, see Command not found errors, The "aws --version" command returns a different version than you installed, and The "aws --version" command returns a version after uninstalling the AWS CLI.