Installing AWS CLI v2 through PIP on Windows

Viewed 10433

Is it possible to install AWS CLI v2 through PIP on Windows?

In the instructions the recommended way to install is via MSI, but I want to use PIP.

What if I install CLI like given on Github in a Linux way:

python -m pip install awscli

Will it install v1 or v2 by default?

3 Answers

Is it possible to install AWS CLI v2 through PIP on Windows?

No, not from pypi at least. The instructions from github you ahve linked to apply only to version 1.18 and also the pypi project is at 1.18.

If you switch to the v2 branch on github, you will also notice that any reference to using pip for installing is gone, so the recommended way does indeed seem to only be to use the .msi installer.

This does not need to stop you per se, but since there is no whl file, installing with pip would mean to try to compile the source code, which is probably a pain on windows. you can still try it though, the command would be something like

python -m pip install git+https://github.com/aws/aws-cli/tree/v2

For people would like to use pipx to isolate between environments, the url mentioned by @FlyingTeller git+https://github.com/aws/aws-cli/tree/v2 does not work with pipx, instead you can try this:

pipx install git+https://github.com/aws/aws-cli.git@v2

After that you can see:

$ aws --version
aws-cli/2.4.17 Python/3.9.9 Linux/5.4.0-99-generic source/x86_64.ubuntu.20 prompt/off

pip install awscliv2

This single command should help you install awc cli v2

Related