

**This documentation is for Version 1 of the AWS CLI only.**

We announced the upcoming end-of-support for the AWS CLI version 1. We recommend that you migrate to the AWS CLI version 2. For dates, additional details, and information on how to migrate, see the [announcement](https://aws.amazon.com/blogs/developer/cli-v1-maintenance-mode-announcement/). For documentation related to Version 2 of the AWS CLI, see the [Version 2 User Guide](https://docs.aws.amazon.com/cli/latest/userguide/).

# Installing, updating, and uninstalling the AWS CLI
<a name="cli-chap-install"></a>

This topic provides links to install, update, and uninstall the original version of the AWS Command Line Interface (AWS CLI). The AWS CLI version 1 is currently supported, but new features added to the AWS CLI version 2 might not be added to the AWS CLI version 1. To use those features, you must install the AWS CLI version 2. For information about how to install version 2, see [Installing the AWS CLI version 2](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-started.html).

**Topics**
+ [

## Python version requirements
](#cli-chap-install-python)
+ [Amazon Linux](install-linux-al2017.md)
+ [Linux](install-linux.md)
+ [macOS](install-macos.md)
+ [Windows](install-windows.md)
+ [Virtualenv](install-virtualenv.md)

## Python version requirements
<a name="cli-chap-install-python"></a>

The AWS CLI version 1 is built using the SDK for Python, and therefore requires you to install a compatible version of Python.

**Python version support matrix**


| AWS CLI version | Supported Python version | 
| --- | --- | 
| 1.39.0 – current | Python 3.9\$1 | 
| 1.32.0 – 1.38.38 | Python 3.8\$1 | 
| 1.27.0 – 1.31.x | Python 3.7\$1 | 
| 1.20.0 – 1.26.x | Python 3.6\$1 | 
| 1.19.0 – 1.19.x | Python 2.7\$1, Python 3.6\$1 | 
| 1.17 – 1.18.x | Python 2.7\$1, Python 3.4\$1 | 
| 1.0 – 1.16.x | Python 2.6 and older, Python 3.3 and older | 

For information on the latest releases of AWS CLI, see the [AWS CLI version 2 Changelog](https://raw.githubusercontent.com/aws/aws-cli/v2/CHANGELOG.rst) on GitHub.

# Installing, updating, and uninstalling the AWS CLI version 1 on Amazon Linux
<a name="install-linux-al2017"></a>

The AWS CLI version 1 is preinstalled on Amazon Linux and Amazon Linux 2. Check the currently installed version by using the following command.

```
$ aws --version
aws-cli/1.40.41 Python/3.11.6 Linux/5.10.205-195.807.amzn2.x86_64 botocore/1.18.6
```

Depending on when you created your Amazon Linux instance, the AWS CLI version 1 is preinstalled using one of the following package managers:
+ [pip](#install-amazon-linux-pip)
+ [yum](#install-amazon-linux-yum)

## Prerequisites
<a name="install-amazon-linux-prereq"></a>

You must have Python 3.8 or later installed. For installation instructions, see the [Downloading Python](https://wiki.python.org/moin/BeginnersGuide/Download) page in Python's *Beginner Guide*.

**Python version support matrix**


| AWS CLI version | Supported Python version | 
| --- | --- | 
| 1.39.0 – current | Python 3.9\$1 | 
| 1.32.0 – 1.38.38 | Python 3.8\$1 | 
| 1.27.0 – 1.31.x | Python 3.7\$1 | 
| 1.20.0 – 1.26.x | Python 3.6\$1 | 
| 1.19.0 – 1.19.x | Python 2.7\$1, Python 3.6\$1 | 
| 1.17 – 1.18.x | Python 2.7\$1, Python 3.4\$1 | 
| 1.0 – 1.16.x | Python 2.6 and older, Python 3.3 and older | 

## Install, update, or uninstall using pip
<a name="install-amazon-linux-pip"></a>

Most Amazon Linux instances use pip to preinstall the AWS CLI version 1.

### Install or update the AWS CLI version 1 on Amazon Linux using pip
<a name="install-amazon-linux-pip-install"></a>

To install the latest version of the AWS CLI version 1 for the current user, use the following instructions.

1. We recommend that if you have Python version 3 or later installed that you use `pip3`. Use `pip3 install` to install or update to the latest version of the AWS CLI version 1. If you run the command from within a [Python virtual environment (venv)](https://docs.python.org/3/library/venv.html), you don't need to use the `--user` option. 

   ```
   $ pip3 install --upgrade --user awscli
   ```

1. Ensure the folder that contains `aws` is part of your `PATH` variable.

   1. 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`

   1. Add an export command at the end of your profile script that's similar to the following example.

      ```
      export PATH=$HOME/.local/bin:$PATH
      ```

      This command inserts the path, `$HOME/.local/bin` in this example, at the front of the existing `$PATH`variable.

   1. Reload the profile into your current session to put those changes into effect.

      ```
      $ source ~/.bash_profile
      ```

1. To verify that you're running the new version, use the `aws --version` command.

   ```
   $ aws --version
   aws-cli/1.40.41 Python/3.11.6 Linux/5.10.205-195.807.amzn2.x86_64 botocore/1.18.6
   ```

### Uninstall the AWS CLI version 1 using pip
<a name="install-amazon-linux-pip-uninstall"></a>

If you need to uninstall the AWS CLI, use `pip uninstall`.

```
$ pip3 uninstall awscli
```

## Install, update, or uninstall using yum
<a name="install-amazon-linux-yum"></a>

Most Amazon Linux 2 instances use yum to preinstall the AWS CLI version 1.

### Install or update the AWS CLI version 1 on Amazon Linux using yum
<a name="install-amazon-linux-yum-install"></a>

To install the latest version of the AWS CLI version 1 available on Amazon Linux, run the following command.

```
$ sudo yum install awscli
```

To update to the latest version of the AWS CLI version 1 available on Amazon Linux, run the following command.

```
$ sudo yum update awscli
```

To verify that you're running the newer version, use the `aws --version` command.

```
$ aws --version
aws-cli/1.40.41 Python/3.11.6 Linux/5.10.205-195.807.amzn2.x86_64 botocore/1.18.6
```

### Uninstall the AWS CLI version 1 using yum
<a name="install-amazon-linux-yum-uninstall"></a>

To uninstall the AWS CLI, use `yum remove`.

```
$ sudo yum remove awscli
```

## Troubleshooting AWS CLI install and uninstall errors
<a name="install-amazon-linux-tshoot"></a>

If you come across issues after installing or uninstalling the AWS CLI, see [Troubleshooting errors for the AWS CLI](cli-chap-troubleshooting.md) for troubleshooting steps. For the most relevant troubleshooting steps, see [Command not found errors](cli-chap-troubleshooting.md#tshoot-install-not-found), [The "`aws --version`" command returns a different version than you installed](cli-chap-troubleshooting.md#tshoot-install-wrong-version), and [The "`aws --version`" command returns a version after uninstalling the AWS CLI](cli-chap-troubleshooting.md#tshoot-uninstall-1).

# Installing, updating, and uninstalling the AWS CLI version 1 on Linux
<a name="install-linux"></a>

You can install the AWS Command Line Interface (AWS CLI) version 1 and its dependencies on most Linux distributions by using the `pip` package manager or the bundled installer.

Although the `awscli` package is available in repositories for other package managers such as `apt` and `yum`, these are not produced, managed, or supported by AWS. We recommend that you install the AWS CLI from only the official AWS distribution points, as documented in this guide.

**Topics**
+ [

## Prerequisites
](#install-linux-prereqs)
+ [

## Install and uninstall the AWS CLI version 1 on Linux using the bundled installer
](#install-linux-bundled)
+ [

## Install and uninstall the AWS CLI version 1 using pip
](#install-linux-pip)
+ [

## Install and uninstall the AWS CLI version 1 using Snapcraft
](#install-linux-snap)
+ [

## Add the AWS CLI version 1 executable to your command line path
](#install-linux-path)
+ [

## Troubleshooting AWS CLI install and uninstall errors
](#install-linux-tshoot)

## Prerequisites
<a name="install-linux-prereqs"></a>

You must have Python 3.8 or later installed. For installation instructions, see the [Downloading Python](https://wiki.python.org/moin/BeginnersGuide/Download) page in Python's *Beginner Guide*.

**Python version support matrix**


| AWS CLI version | Supported Python version | 
| --- | --- | 
| 1.39.0 – current | Python 3.9\$1 | 
| 1.32.0 – 1.38.38 | Python 3.8\$1 | 
| 1.27.0 – 1.31.x | Python 3.7\$1 | 
| 1.20.0 – 1.26.x | Python 3.6\$1 | 
| 1.19.0 – 1.19.x | Python 2.7\$1, Python 3.6\$1 | 
| 1.17 – 1.18.x | Python 2.7\$1, Python 3.4\$1 | 
| 1.0 – 1.16.x | Python 2.6 and older, Python 3.3 and older | 

## Install and uninstall the AWS CLI version 1 on Linux using the bundled installer
<a name="install-linux-bundled"></a>

On Linux or macOS, you can use the bundled installer to install version 1 of the AWS CLI. The bundled installer includes all dependencies and can be used offline.

**Note**  
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`
](#install-linux-bundled-sudo)
+ [

### Install the AWS CLI version 1 using the bundled installer without `sudo`
](#install-linux-bundled-no-sudo)
+ [

### Uninstall the AWS CLI version 1 bundled installer
](#install-linux-bundled-uninstall)

### Install the AWS CLI version 1 using the bundled installer with `sudo`
<a name="install-linux-bundled-sudo"></a>

The following steps enable you to install the AWS CLI version 1 from the command line on any build of Linux or macOS.

The following is a summary of the installation commands explained below 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
```

Follow these steps from the command line to install the AWS CLI version 1 using the bundled installer.

**To install the AWS CLI version 1 using the bundled installer**

1. Download the AWS CLI version 1 bundled installer using one of the the following methods.
   + Download using the `curl` command.

     **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.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"
     ```
   + Download using the direct link.

     **For the latest version of the AWS CLI:** [https://s3.amazonaws.com/aws-cli/awscli-bundle.zip](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.312* would be `awscli-bundle-1.16.312.zip` resulting in the following url [https://s3.amazonaws.com/aws-cli/awscli-bundle-1.16.312.zip](https://s3.amazonaws.com/aws-cli/awscli-bundle-1.16.312.zip)

1. Extract the files from the package. If you don't have `unzip` to extract the files, use your Linux distribution's built-in package manager to install it.

   ```
   $ unzip awscli-bundle.zip
   ```

1. Run the install program. The installer installs the AWS CLI at `/usr/local/aws` and creates the symlink `aws` at the `/usr/local/bin` directory. Using the `-b` option to create a symlink eliminates the need to specify the install directory in the user's `$PATH` variable. This should enable all users to call the AWS CLI by entering `aws` from any directory.

   ```
   $ sudo ./awscli-bundle/install -i /usr/local/aws -b /usr/local/bin/aws
   ```

   By 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 version 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.7 awscli-bundle/install -i /usr/local/aws -b /usr/local/bin/aws
   ```

1. Verify that the AWS CLI installed correctly.

   ```
   $ aws --version
   aws-cli/1.40.41 Python/3.11.6 Linux/5.10.205-195.807.amzn2.x86_64 botocore/1.18.6
   ```

   If you get an error, see [Troubleshooting errors for the AWS CLI](cli-chap-troubleshooting.md).

### Install the AWS CLI version 1 using the bundled installer without `sudo`
<a name="install-linux-bundled-no-sudo"></a>

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 current user**

1. Download the AWS CLI version 1 bundled installer in one of the following ways.
   + Download using the `curl` command.

     **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.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"
     ```
   + Download using the direct link.

     **For the latest version of the AWS CLI:** [https://s3.amazonaws.com/aws-cli/awscli-bundle.zip](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.312* would be `awscli-bundle-1.16.312.zip` resulting in the following url [https://s3.amazonaws.com/aws-cli/awscli-bundle-1.16.312.zip](https://s3.amazonaws.com/aws-cli/awscli-bundle-1.16.312.zip)

1. Extract the files from the package by using `unzip`. If you don't have `unzip`, use your Linux distribution's built-in package manager to install it.

   ```
   $ unzip awscli-bundle.zip
   ```

1. Run the install program. The installer installs the AWS CLI at `/usr/local/aws` and creates the symlink `aws` at the `/usr/local/bin` directory. The command uses the `-b` parameter to specify the directory where the installer places the `aws` symlink file. You must have write permissions to the specified folder.

   ```
   $ ./awscli-bundle/install -b ~/bin/aws
   ```

   This installs the AWS CLI to the default location (`~/.local/lib/aws`) and creates a symbolic link (symlink) at `~/bin/aws`. Make sure that `~/bin` is in your `PATH` environment 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
   ```

1. Ensure the directory that the AWS CLI version 1 is part of your `PATH` variable.

   1. 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`, `.cshrc` or `.login`

   1. Add an export command at the end of your profile script that's similar to the following example.

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

      This command inserts the path, `~/.local/bin` in this example, at the front of the existing `PATH` variable.

   1. Reload the profile into your current session to put those changes into effect.

      ```
      $ source ~/.bash_profile
      ```

1. Verify that the AWS CLI installed correctly.

   ```
   $ aws --version
   aws-cli/1.40.41 Python/3.11.6 Linux/5.10.205-195.807.amzn2.x86_64 botocore/1.18.6
   ```

   If you get an error, see [Troubleshooting errors for the AWS CLI](cli-chap-troubleshooting.md).

### Uninstall the AWS CLI version 1 bundled installer
<a name="install-linux-bundled-uninstall"></a>

1. If you installed the AWS CLI using the bundled installer, follow these instructions. The bundled installer doesn't put anything outside of the installation directory except the optional symlink, so uninstalling is as simple as deleting those two items.

   ```
   $ sudo rm -rf /usr/local/aws
   $ sudo rm -rf /usr/local/bin/aws
   ```

1. **(Optional)** Remove the shared AWS SDK and AWS CLI settings information in the `.aws` folder.
**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 `.aws` folder differs between platforms, by default the folder is located in *\$1/.aws/*. If your user has write permission to this directory, you don't need to use `sudo`.

   ```
   $ sudo rm -r ~/.aws/
   ```

## Install and uninstall the AWS CLI version 1 using pip
<a name="install-linux-pip"></a>

**Topics**
+ [

### Install pip
](#install-linux-pip-pip)
+ [

### Install and update the AWS CLI version 1 using pip
](#install-linux-awscli)
+ [

### Uninstall the AWS CLI using pip
](#post-install-uninstall)

### Install pip
<a name="install-linux-pip-pip"></a>

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.

1. Use the `curl` command 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 directory using the same name it has on the remote host.

   ```
   $ curl -O https://bootstrap.pypa.io/get-pip.py
   ```

1. Run the script with the `python` or `python3` command to download and install the latest version of `pip` and other required support packages. When you include the `--user` switch, the script installs `pip` to the path `~/.local/bin`.

   ```
   $ python3 get-pip.py --user
   ```

1. Ensure the directory that contains `pip` is part of your `PATH` variable.

   1. 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`, `.cshrc` or `.login`

   1. Add an export command at the end of your profile script that's similar to the following example.

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

      This command inserts the path, `~/.local/bin` in this example, at the front of the existing `PATH` variable.

   1. Reload the profile into your current session to put those changes into effect.

      ```
      $ source ~/.bash_profile
      ```

1. To verify that `pip` or `pip3` is installed correctly, run the following command.

   ```
   $ pip3 --version
   pip 24.0 from ~/.local/lib/python3.7/site-packages (python 3.7)
   ```

### Install and update the AWS CLI version 1 using pip
<a name="install-linux-awscli"></a>

1. Use the `pip` or `pip3` command to install or update the AWS CLI. We recommend that if you use Python version 3 or later that you use the `pip3` command. The `--user` switch, `pip` installs the AWS CLI to `~/.local/bin`. 

   **For the latest version of the AWS CLI,** use the following command block:

   ```
   $ pip3 install awscli --upgrade --user
   ```

   **For a specific version of the AWS CLI,** append two equals signs `=` and the version number to the filename. For this example the filename for version *1.16.312* would be *==1.16.312* resulting in the following command:

   ```
   $ pip3 install awscli==1.16.312 --upgrade --user
   ```
**Note**  
Use appropriate quoting rules for your terminal. In order 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
   ```

1. Verify that the AWS CLI installed correctly.

   ```
   $ aws --version
   aws-cli/1.40.41 Python/3.11.6 Linux/5.10.205-195.807.amzn2.x86_64 botocore/1.18.6
   ```

   If you get an error, see [Troubleshooting errors for the AWS CLI](cli-chap-troubleshooting.md).

### Uninstall the AWS CLI using pip
<a name="post-install-uninstall"></a>

1. If you installed the AWS CLI version 1 using `pip`, you must also uninstall using `pip`.

   ```
   $ pip uninstall awscli
   ```

    If you are using version Python 2 or 3, you might need to use the `pip2` or `pip3` command. Use the `aws --version` command to determine the Python version associated with your installed AWS CLI version 1.

   ```
   $ pip3 uninstall awscli
   ```

   You might need to restart your command prompt window or your computer to remove all files.

1. **(Optional)** Remove the shared AWS SDK and AWS CLI settings information in the `.aws` folder.
**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 `.aws` folder differs between platforms, by default the folder is located in *\$1/.aws/*. If your user has write permission to this directory, you don't need to use `sudo`.

   ```
   $ sudo rm -r ~/.aws/
   ```

## Install and uninstall the AWS CLI version 1 using Snapcraft
<a name="install-linux-snap"></a>

**Topics**
+ [

### Install snap
](#install-linux-snap-install)
+ [

### Install and update the AWS CLI version 1 using snap
](#install-linux-snap-update)
+ [

### Uninstall the AWS CLI using snap
](#install-linux-snap-uninstall)

### Install snap
<a name="install-linux-snap-install"></a>

If you don't already have `snap` installed, you can install it by using the instructions *Canonical Snapcraft* provides. Run `snap version` to see if your version of Linux already includes `snap`.

1. Install Snapcraft on your platform. For information on installing Snapcraft, see [Installing the daemon](https://snapcraft.io/docs/installing-snapd) in the *Snap documentation*.

1. Restart your system so that your `PATH` variables are updated correctly. If you are having installation issues, follow steps in [Fix common issues](https://snapcraft.io/docs/fix-common-issues) in the *Snap documentation*.

1. To verify that `snap` is installed correctly, run the following command.

   ```
   $ snap version
   ```

### Install and update the AWS CLI version 1 using snap
<a name="install-linux-snap-update"></a>

1. Run the following `snap install` command for the AWS CLI version 1.

   ```
   $ snap install aws-cli --channel=v1/stable --classic
   ```

   Depending on your permissions, you may need to add `sudo` to your command.

   ```
   $ sudo snap install aws-cli --channel=v1/stable --classic
   ```

1. Verify that the AWS CLI installed correctly.

   ```
   $ aws --version
   aws-cli/1.40.41 Python/3.11.6 Linux/5.10.205-195.807.amzn2.x86_64 botocore/1.18.6
   ```

   If you get an error, see [Troubleshooting errors for the AWS CLI](cli-chap-troubleshooting.md).

### Uninstall the AWS CLI using snap
<a name="install-linux-snap-uninstall"></a>

1. If you installed the AWS CLI version 1 using `snap`, you must also uninstall using `snap`.

   ```
   $ snap remove aws-cli
   ```

   You might need to restart your command prompt window or your computer to remove all files.

1. **(Optional)** Remove the shared AWS SDK and AWS CLI settings information in the `.aws` folder.
**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 `.aws` folder differs between platforms, by default the folder is located in *\$1/.aws/*. If you have write permissions to this directory, you don't need to use `sudo`.

   ```
   $ sudo rm -r ~/.aws/
   ```

## Add the AWS CLI version 1 executable to your command line path
<a name="install-linux-path"></a>

After installing with `pip` or `snap`, you might need to add the `aws` executable to your operating system' `PATH` environment variable.

You can verify which folder `pip` installed the AWS CLI in by running the following command.

```
$ which aws
/home/username/.local/bin/aws
```

You can reference this as `~/.local/bin/` because `/home/username` corresponds to `~` in Linux.

If you omitted the `--user` switch and so didn't install in user mode, the executable might be in the `bin` folder of your Python installation. If you don't know where Python is installed, run this command.

```
$ which python
/usr/local/bin/python
```

The output might be the path to a symlink, not to the actual executable. Run `ls -al` to see where it points.

```
$ ls -al /usr/local/bin/python
/usr/local/bin/python -> ~/.local/Python/3.6/bin/python3.6
```

`pip` installs programs in the same folder that contains the Python application. Add this folder to your `PATH` variable.

**To modify your `PATH` variable**

1. 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`

1. Add an export command to your profile script.

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

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

1. Load the updated profile into your current session.

   ```
   $ source ~/.bash_profile
   ```

## Troubleshooting AWS CLI install and uninstall errors
<a name="install-linux-tshoot"></a>

If you come across issues after installing or uninstalling the AWS CLI, see [Troubleshooting errors for the AWS CLI](cli-chap-troubleshooting.md) for troubleshooting steps. For the most relevant troubleshooting steps, see [Command not found errors](cli-chap-troubleshooting.md#tshoot-install-not-found), [The "`aws --version`" command returns a different version than you installed](cli-chap-troubleshooting.md#tshoot-install-wrong-version), and [The "`aws --version`" command returns a version after uninstalling the AWS CLI](cli-chap-troubleshooting.md#tshoot-uninstall-1).

# Installing, updating, and uninstalling the AWS CLI version 1 on macOS
<a name="install-macos"></a>

You can install the AWS Command Line Interface (AWS CLI) version 1 and its dependencies on macOS by using the bundled installer or `pip`. 

**Topics**
+ [

## Prerequisites
](#install-macosos-prereq)
+ [

## Install, update and uninstall the AWS CLI version 1 on macOS using the bundled installer
](#install-macosos-bundled)
+ [

## Install, update and uninstall the AWS CLI version 1 using pip
](#awscli-install-osx-pip)
+ [

## Troubleshooting AWS CLI install and uninstall errors
](#awscli-install-osx-tshoot)

## Prerequisites
<a name="install-macosos-prereq"></a>

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](https://wiki.python.org/moin/BeginnersGuide/Download) page in Python's *Beginner Guide*.

**Python version support matrix**


| AWS CLI version | Supported Python version | 
| --- | --- | 
| 1.39.0 – current | Python 3.9\$1 | 
| 1.32.0 – 1.38.38 | Python 3.8\$1 | 
| 1.27.0 – 1.31.x | Python 3.7\$1 | 
| 1.20.0 – 1.26.x | Python 3.6\$1 | 
| 1.19.0 – 1.19.x | Python 2.7\$1, Python 3.6\$1 | 
| 1.17 – 1.18.x | Python 2.7\$1, Python 3.4\$1 | 
| 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
<a name="install-macosos-bundled"></a>

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`
](#install-macosos-bundled-sudo)
+ [

### Install the AWS CLI version 1 using the bundled installer without `sudo`
](#install-macosos-bundled-no-sudo)
+ [

### Uninstall the AWS CLI version 1 bundled installer
](#install-macosos-bundled-uninstall)

### Install the AWS CLI version 1 using the bundled installer with `sudo`
<a name="install-macosos-bundled-sudo"></a>

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**

1. Download the AWS CLI version 1 bundled installer in one of the following ways:
   + Download using the `curl` command.

     **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.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"
     ```
   + Download using the direct link.

     **For the latest version of the AWS CLI:** [https://s3.amazonaws.com/aws-cli/awscli-bundle.zip](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.312* would be `awscli-bundle-1.16.312.zip` resulting in the following url [https://s3.amazonaws.com/aws-cli/awscli-bundle-1.16.312.zip](https://s3.amazonaws.com/aws-cli/awscli-bundle-1.16.312.zip)

1. 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
   ```

1. Run the install program. The installer installs the AWS CLI at `/usr/local/aws` and creates the symlink `aws` at the `/usr/local/bin` folder. Using the `-b` option to create a symlink eliminates the need to specify the install folder in the user's `$PATH` variable. This should enable all users to call the AWS CLI by entering `aws` from any directory.

   ```
   $ sudo ./awscli-bundle/install -i /usr/local/aws -b /usr/local/bin/aws
   ```

   By 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.7 awscli-bundle/install -i /usr/local/aws -b /usr/local/bin/aws
   ```

1. Verify that the AWS CLI installed correctly.

   ```
   $ aws --version
   aws-cli/1.40.41 Python/3.11.6 Linux/5.10.205-195.807.amzn2.x86_64 botocore/1.18.6
   ```

   If you get an error, see [Troubleshooting errors for the AWS CLI](cli-chap-troubleshooting.md).

### Install the AWS CLI version 1 using the bundled installer without `sudo`
<a name="install-macosos-bundled-no-sudo"></a>

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**

1. Download the AWS CLI version 1 bundled installer using one of the the following methods:
   + Download using the `curl` command.

     **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.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"
     ```
   + Download using the direct link.

     **For the latest version of the AWS CLI:** [https://s3.amazonaws.com/aws-cli/awscli-bundle.zip](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.312* would be `awscli-bundle-1.16.312.zip` resulting in the following url [https://s3.amazonaws.com/aws-cli/awscli-bundle-1.16.312.zip](https://s3.amazonaws.com/aws-cli/awscli-bundle-1.16.312.zip)

1. 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
   ```

1. Run the install program. The installer installs the AWS CLI at `/usr/local/aws` and creates the symlink `aws` at the `/usr/local/bin` directory. The command uses the `-b` parameter to specify the directory where the installer places the `aws` symlink file. You must have write permissions to the specified directory.

   ```
   $ ./awscli-bundle/install -b ~/bin/aws
   ```

   This installs the AWS CLI to the default location (`~/.local/lib/aws`) and creates a symbolic link (symlink) at `~/bin/aws`. Make sure that `~/bin` is in your `$PATH` environment 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
   ```

1. Ensure the folder that the AWS CLI version 1 is installed in is part of your `$PATH` variable.

   1. 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`, `.cshrc` or `.login`

   1. Add an export command at the end of your profile script that's similar to the following example.

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

      This command inserts the path, `~/.local/bin` in this example, at the front of the existing `PATH` variable.

   1. Reload the profile into your current session to put those changes into effect.

      ```
      $ source ~/.bash_profile
      ```

1. Verify that the AWS CLI installed correctly.

   ```
   $ aws --version
   aws-cli/1.40.41 Python/3.11.6 Linux/5.10.205-195.807.amzn2.x86_64 botocore/1.18.6
   ```

   If you get an error, see [Troubleshooting errors for the AWS CLI](cli-chap-troubleshooting.md).

### Uninstall the AWS CLI version 1 bundled installer
<a name="install-macosos-bundled-uninstall"></a>

1. 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
   ```

1. **(Optional)** Remove the shared AWS SDK and AWS CLI settings information in the `.aws` folder.
**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 `.aws` folder differs between platforms, by default the folder is located in *\$1/.aws/*. If your user has write permission to this directory, you don't need to use `sudo`.

   ```
   $ sudo rm ~/.aws/
   ```

## Install, update and uninstall the AWS CLI version 1 using pip
<a name="awscli-install-osx-pip"></a>

You can use `pip` directly to install the AWS CLI. 

**Topics**
+ [

### Install pip
](#awscli-install-osx-pip-pip)
+ [

### Install and update the AWS CLI using pip
](#awscli-install-osx-pip-install)
+ [

### Add the AWS CLI version 1 executable to your macOS command line path
](#awscli-install-osx-path)
+ [

### Uninstall the AWS CLI using pip
](#awscli-install-osx-pip-uninstall)

### Install pip
<a name="awscli-install-osx-pip-pip"></a>

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.

1. Use the `curl` command 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
   ```

1. Run the script with the `python` or `python3` command to download and install the latest version of `pip` and other required support packages. When you include the `--user` switch, the script installs `pip` to the path `~/.local/bin`.

   ```
   $ python3 get-pip.py --user
   ```

### Install and update the AWS CLI using pip
<a name="awscli-install-osx-pip-install"></a>

1. Use the `pip` or `pip3` command to install the AWS CLI. We recommend that if you use Python version 3 or later, that you use the `pip3` command.

   **For the latest version of the AWS CLI,** use the following command block:

   ```
   $ pip3 install awscli --upgrade --user
   ```

   **For a specific version of the AWS CLI,** append two equals signs `=` and the version number to the filename. For this example the filename for version *1.16.312* would be *==1.16.312* resulting in the following command:

   ```
   $ pip3 install awscli==1.16.312 --upgrade --user
   ```
**Note**  
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
   ```

1. Verify that the AWS CLI is installed correctly.

   ```
   $ aws --version
   aws-cli/1.40.41 Python/3.11.6 Darwin/23.3.0 botocore/1.18.6
   ```

   If the program isn't found, [add it to your command line path](#awscli-install-osx-path).

### Add the AWS CLI version 1 executable to your macOS command line path
<a name="awscli-install-osx-path"></a>

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**

1. 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`

1. Add an export command to your profile script.

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

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

1. Load the updated profile into your current session.

   ```
   $ source ~/.bash_profile
   ```

### Uninstall the AWS CLI using pip
<a name="awscli-install-osx-pip-uninstall"></a>

1. If you installed the AWS CLI version 1 using `pip`, you must also uninstall using `pip`.

   ```
   $ pip uninstall awscli
   ```

    If you are using version Python 2 or 3, you might need to use the `pip2` or `pip3` command. Use the `aws --version` command to determine the Python version associated with your installed AWS CLI version 1.

   ```
   $ pip3 uninstall awscli
   ```

   You might need to restart your command prompt window or your computer to remove all files.

1. **(Optional)** Remove the shared AWS SDK and AWS CLI settings information in the `.aws` folder.
**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 `.aws` folder differs between platforms, by default the folder is located in *\$1/.aws/*. If your user has write permission to this directory, you don't need to use `sudo`.

   ```
   $ sudo rm -rf ~/.aws/
   ```

## Troubleshooting AWS CLI install and uninstall errors
<a name="awscli-install-osx-tshoot"></a>

If you come across issues after installing or uninstalling the AWS CLI, see [Troubleshooting errors for the AWS CLI](cli-chap-troubleshooting.md) for troubleshooting steps. For the most relevant troubleshooting steps, see [Command not found errors](cli-chap-troubleshooting.md#tshoot-install-not-found), [The "`aws --version`" command returns a different version than you installed](cli-chap-troubleshooting.md#tshoot-install-wrong-version), and [The "`aws --version`" command returns a version after uninstalling the AWS CLI](cli-chap-troubleshooting.md#tshoot-uninstall-1).

# Installing, Updating, and Uninstalling the AWS CLI version 1 on Windows
<a name="install-windows"></a>

You can install version 1 of the AWS Command Line Interface (AWS CLI) on Windows by using a standalone installer (recommended) or `pip`, which is a package manager for Python.

Don't include the prompt symbol (`C:\>`) when you type a command. These are included in program listings to differentiate commands that you type from output returned by the AWS CLI. The rest of this guide uses the generic prompt symbol (`$`), except in cases where a command is Windows-specific.

**Topics**
+ [

## Install, update, and uninstall the AWS CLI version 1 using the MSI installer
](#msi-on-windows)
+ [

## Install, update, and uninstall the AWS CLI version 1 using Python and pip on Windows
](#awscli-install-windows-pip)
+ [

## Add the AWS CLI version 1 executable to your command line path
](#awscli-install-windows-path)
+ [

## Troubleshooting AWS CLI install and uninstall errors
](#awscli-install-windows-tshoot)

## Install, update, and uninstall the AWS CLI version 1 using the MSI installer
<a name="msi-on-windows"></a>

The AWS CLI version 1 is supported on Windows XP or later. For Windows users, the MSI installation package offers a familiar and convenient way to install the AWS CLI version 1 without installing any other prerequisites. 

### Install and update the AWS CLI version 1 using the MSI installer
<a name="install-msi-on-windows"></a>

Check the [Releases](https://github.com/aws/aws-cli/releases) page on GitHub to see when the latest version was released. When updates are released, you must repeat the installation process to get the latest version of the AWS CLI version 1. 

1. Download the appropriate MSI installer:
   + AWS CLI MSI installer for Windows (64-bit): [https://s3.amazonaws.com/aws-cli/AWSCLI64PY3.msi](https://s3.amazonaws.com/aws-cli/AWSCLI64PY3.msi)
   + AWS CLI MSI installer for Windows (32-bit): [https://s3.amazonaws.com/aws-cli/AWSCLI32PY3.msi](https://s3.amazonaws.com/aws-cli/AWSCLI32PY3.msi)
   + AWS CLI combined setup file for Windows: [ https://s3.amazonaws.com/aws-cli/AWSCLISetup.exe](https://s3.amazonaws.com/aws-cli/AWSCLISetup.exe) (includes both the 32-bit and 64-bit MSI installers, and automatically installs the correct version)

1. Run the downloaded MSI installer or the setup file.

1. Follow the on-screen instructions. By default, the AWS CLI version 1 installs to `C:\Program Files\Amazon\AWSCLI` (64-bit version) or `C:\Program Files (x86)\Amazon\AWSCLI` (32-bit version). 

1. To confirm the installation, use the `aws --version` command at a command prompt (open the **Start** menu and search for `cmd` to start a command prompt).

   ```
   C:\> aws --version
   aws-cli/1.40.41 Python/3.11.6 Windows/10 botocore/1.18.6
   ```

   If Windows is unable to find the program, you might need to close and reopen the command prompt to refresh the path, or [add the installation directory to your PATH](#awscli-install-windows-path) environment variable manually.

### Uninstall the AWS CLI version 1
<a name="install-msi-uninstall"></a>

To use the following uninstall instructions, you need to have installed the AWS CLI version 1 with the MSI installer or setup file.

1. Open **Programs and Features** by doing one of the following:
   + Open the **Control Panel**, and then choose **Programs and Features**.
   + Open a command prompt and enter the following command.

     ```
     C:\> appwiz.cpl
     ```

1. Select the entry named **AWS Command Line Interface**, and then choose **Uninstall** to launch the uninstaller.

1. Confirm that you want to uninstall the AWS CLI.

1. **(Optional)** Remove the shared AWS SDK and AWS CLI settings information in the `.aws` folder.
**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 `.aws` folder differs between platforms, by default the folder is located in *%UserProfile%\$1.aws*.

   ```
   $ rmdir %UserProfile%\.aws
   ```

## Install, update, and uninstall the AWS CLI version 1 using Python and pip on Windows
<a name="awscli-install-windows-pip"></a>

The Python Software Foundation provides installers for Windows that include `pip`.

### Prerequisites
<a name="awscli-install-windows-pip-prereqs"></a>

You must have Python 3.8 or later installed. For installation instructions, see the [Downloading Python](https://wiki.python.org/moin/BeginnersGuide/Download) page in Python's *Beginner Guide*.

### Install and update the AWS CLI version 1 using pip
<a name="awscli-install-windows-pip-python"></a>

1. To Install the AWS CLI version 1, use the `pip3` command (if you use Python version 3 or later) or the `pip` command.

   **For the latest version of the AWS CLI,** use the following command block:

   ```
   C:\> pip3 install awscli --upgrade --user
   ```

   **For a specific version of the AWS CLI,** append a less-than symbol `<` and the version number to the filename. For this example the filename for version *1.16.312* would be *<1.16.312* resulting in the following command:

   ```
   C:\> pip3 install awscli<1.16.312 --upgrade --user
   ```

1. Verify that the AWS CLI version 1 is installed correctly. If there is no response, see the [Add the AWS CLI version 1 executable to your command line path](#awscli-install-windows-path) section.

   ```
   C:\> aws --version
   aws-cli/1.40.41 Python/3.11.6 Windows/10 botocore/1.18.6
   ```

### Uninstall the AWS CLI version 1 using pip
<a name="awscli-install-windows-pip-uninstall"></a>

1. If you installed the AWS CLI version 1 using `pip`, you must also uninstall using `pip`.

   ```
   C:\> pip uninstall awscli
   ```

    If you are using version Python 2 or 3, you might need to use the `pip2` or `pip3` command. Use the `aws --version` command to determine the Python version associated with your installed AWS CLI version 1.

   ```
   C:\> pip3 uninstall awscli
   ```

   You might need to restart your command prompt window or your computer to remove all files.

1. **(Optional)** Remove the shared AWS SDK and AWS CLI settings information in the `.aws` folder.
**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 `.aws` folder differs between platforms, by default the folder is located in *%UserProfile%\$1.aws*.

   ```
   $ rmdir %UserProfile%\.aws
   ```

## Add the AWS CLI version 1 executable to your command line path
<a name="awscli-install-windows-path"></a>

After installing the AWS CLI version 1 with `pip`, add the `aws` program to your operating system's `PATH` environment variable. With an MSI installation, this should happen automatically. But if the `aws` command doesn't run after you install it, you might need to set it manually.

1. Use the `where` command to find the `aws` file location. By default, the `where` command shows where a specified program is found in the system's `PATH`. 

   ```
   C:\> where aws
   ```

   The paths that show up depend on your platform and which method you used to install the AWS CLI. Folder names that include version numbers can vary. These examples reflect the use of Python version 3.7. Replace the version with the version number you're using, as needed. Typical paths include the following:
   + **Python 3 and `pip3`** – `C:\Program Files\Python37\Scripts\`
   + **Python 3 and `pip3` --user option on earlier versions of Windows** – `%USERPROFILE%\AppData\Local\Programs\Python\Python37\Scripts`
   + **Python 3 and `pip3` --user option on Windows 10** – `%USERPROFILE%\AppData\Roaming\Python\Python37\Scripts`
   + **MSI installer (64-bit)** – `C:\Program Files\Amazon\AWSCLI\bin`
   + **MSI installer (32-bit)** – `C:\Program Files (x86)\Amazon\AWSCLI\bin`

   Use the following steps based on whether a file path is returned.

------
#### [ A file path is returned ]

   ```
   C:\> where aws
   C:\Program Files\Amazon\AWSCLI\bin\aws.exe
   ```

   You can find where the `aws` program is installed by running the following command.

   ```
   C:\> where c:\ aws
   C:\Program Files\Python37\Scripts\aws
   ```

------
#### [ A file path is NOT returned ]

   If the `where` command returns the following error, it's not in the system `PATH` and you can't run it by entering its name.

   ```
   C:\> where c:\ aws
   INFO: Could not find files for the given pattern(s).
   ```

   In that case, run the `where` command with the `/R path` parameter to tell it to search all folders, and then add the path manually. Use the command line or File Explorer to discover where it's installed on your computer. 

   ```
   C:\> where /R c:\ aws
   c:\Program Files\Amazon\AWSCLI\bin\aws.exe
   c:\Program Files\Amazon\AWSCLI\bincompat\aws.cmd
   c:\Program Files\Amazon\AWSCLI\runtime\Scripts\aws
   c:\Program Files\Amazon\AWSCLI\runtime\Scripts\aws.cmd
   ...
   ```

------

1. Press the Windows key and enter **environment variables**.

1. Choose **Edit environment variables for your account**.

1. Choose **PATH**, and then choose **Edit**.

1. Add the path you found into the **Variable value** field, for example, ***C:\$1Program Files\$1Amazon\$1AWSCLI\$1bin\$1aws.exe***.

1. Choose **OK** twice to apply the new settings.

1. Close any running command prompts and reopen the command prompt window.

## Troubleshooting AWS CLI install and uninstall errors
<a name="awscli-install-windows-tshoot"></a>

If you come across issues after installing or uninstalling the AWS CLI, see [Troubleshooting errors for the AWS CLI](cli-chap-troubleshooting.md) for troubleshooting steps. For the most relevant troubleshooting steps, see [Command not found errors](cli-chap-troubleshooting.md#tshoot-install-not-found), [The "`aws --version`" command returns a different version than you installed](cli-chap-troubleshooting.md#tshoot-install-wrong-version), and [The "`aws --version`" command returns a version after uninstalling the AWS CLI](cli-chap-troubleshooting.md#tshoot-uninstall-1).

# Installing and updating the AWS CLI version 1 in a virtual environment
<a name="install-virtualenv"></a>

You can avoid requirement version conflicts with other `pip` packages by installing version 1 of the AWS Command Line Interface (AWS CLI) in a virtual environment.

**Topics**
+ [

## Prerequisites
](#install-virtualenv-prereqs)
+ [

## Install and update the AWS CLI version 1 in a virtual environment
](#install-virtualenv-install)
+ [

## Troubleshooting AWS CLI install and uninstall errors
](#install-virtualenv-tshoot)

## Prerequisites
<a name="install-virtualenv-prereqs"></a>
+ Python 3.8 or later. For installation instructions, see the [Downloading Python](https://wiki.python.org/moin/BeginnersGuide/Download) page in Python's *Beginner Guide*.

  **Python version support matrix**    
[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/cli/v1/userguide/install-virtualenv.html)
+ `pip` or `pip3` is installed.

## Install and update the AWS CLI version 1 in a virtual environment
<a name="install-virtualenv-install"></a>

1. Install `virtualenv` using `pip`.

   ```
   $ pip install --user virtualenv
   ```

1. Create a virtual environment and name it.

   ```
   $ virtualenv ~/cli-ve
   ```

   Alternatively, you can use the `-p` option to specify a version of Python other than the default.

   ```
   $ virtualenv -p /usr/bin/python37 ~/cli-ve
   ```

1. Activate your new virtual environment.

   **Linux or macOS**

   ```
   $ source ~/cli-ve/bin/activate
   ```

   **Windows**

   ```
   $ %USERPROFILE%\cli-ve\Scripts\activate
   ```

   The prompt changes to show that your virtual environment is active.

   ```
   (cli-ve)~$
   ```

1. Install or update the AWS CLI version 1 into your virtual environment.

   ```
   (cli-ve)~$ pip install --upgrade awscli
   ```

1. Verify that the AWS CLI version 1 is installed correctly.

   ```
   $ aws --version
   aws-cli/1.40.41 Python/3.11.6 Linux/5.10.205-195.807.amzn2.x86_64 botocore/1.18.6
   ```

1. You can use the `deactivate` command to exit the virtual environment. Whenever you start a new session, you must reactivate the environment.

## Troubleshooting AWS CLI install and uninstall errors
<a name="install-virtualenv-tshoot"></a>

If you come across issues after installing or uninstalling the AWS CLI, see [Troubleshooting errors for the AWS CLI](cli-chap-troubleshooting.md) for troubleshooting steps. For the most relevant troubleshooting steps, see [Command not found errors](cli-chap-troubleshooting.md#tshoot-install-not-found), [The "`aws --version`" command returns a different version than you installed](cli-chap-troubleshooting.md#tshoot-install-wrong-version), and [The "`aws --version`" command returns a version after uninstalling the AWS CLI](cli-chap-troubleshooting.md#tshoot-uninstall-1).