Home > Net >  Can't run 'aws' command
Can't run 'aws' command

Time:06-23

I have aws command installed via pip install aws.

Whenever I type in whatever related to aws (such as aws ecr get-login-password), I'm getting following error:

Traceback (most recent call last):
  File "/Users/Stan/.pyenv/versions/3.8.13/envs/rasa/bin/aws", line 5, in <module>
    from aws.main import main
  File "/Users/Stan/.pyenv/versions/3.8.13/envs/rasa/lib/python3.8/site-packages/aws/main.py", line 23
    print '%(name)s: %(endpoint)s' % {
          ^
SyntaxError: invalid syntax

Help would be appreciated.

CodePudding user response:

Confusingly, the aws Python package is not the official one from Amazon, it's some third-party tool that doesn't work the same way. The real one is awscli.

Uninstall the aws package and install awscli:

pip uninstall aws
pip install awscli

And then your aws command should work.

Edit:

There is a new version called awscliv2 which is not installable via pip, and seems to be only installable via downloading a compressed archive. It supports newer AWS features and services that the version 1 tool does not.

CodePudding user response:

The latest AWS CLI v2 is not published to pip. Install instructions are in the AWS docs.

pip package official AWS? CLI version Note
n/a Yes v2 Install instructions here
awscli Yes v1 Supported, but not all v2 features are being backported
aws No n/a "Utility to manage your AWS and run Fabric against filtered set of EC2 instances"
awscliv2 No v2 "Wrapper for AWS CLI v2."
  • Related