You may got this error if the AWS CLI program file doesn't have "run" permission. On Linux or macOS, ensure that
the aws program has run permissions for the calling user. Typically, the permissions are set to 755.
To add run permission for your user, use the below given command.
$ chmod +x /root/.local/bin/aws
Hope this will help.