DEV Community

vindianadoan
vindianadoan

Posted on

Fixing AWS CLI Version Conflicts on Windows

Symptom: You install AWS CLI v2 but aws --version still shows v1.x.x.

Cause: An older aws.exe appears earlier in your PATH than the new CLI. On Windows, the system uses the first match it finds.

Quick Check

Run:

where aws
Enter fullscreen mode Exit fullscreen mode

You might see:

C:\Users\YourName\anaconda3\Scripts\aws
C:\Users\YourName\anaconda3\Scripts\aws.cmd
C:\Program Files\Amazon\AWSCLIV2\aws.exe
Enter fullscreen mode Exit fullscreen mode

The first path is always used (in this example, Anaconda’s AWS CLI v1).

Two Fixes

1. Remove the Old CLI

If installed via conda:

conda remove awscli
Enter fullscreen mode Exit fullscreen mode

If installed via pip:

pip uninstall awscli
Enter fullscreen mode Exit fullscreen mode

Then, confirm by running:

where aws
Enter fullscreen mode Exit fullscreen mode

You should now see only:

C:\Program Files\Amazon\AWSCLIV2\aws.exe
Enter fullscreen mode Exit fullscreen mode

And aws --version should show 2.x.x.

2. Reorder PATH

If you can’t remove the old CLI:

  • Open System Properties → Environment Variables → Path.
  • Move: C:\Program Files\Amazon\AWSCLIV2\ above any Python or Anaconda paths.
  • Restart your terminal and run aws --version again.

Top comments (0)