aws-shell "'Namespace' object has no attribute 'cli_binary_format'"

问题

https://github.com/awslabs/aws-shell/issues/238

aws-shell中运行cli命令时候失败

img

这个是因为当前aws-shell 并不支持 awscli v2

解决办法

mac

  1. 卸载v2版本的awscli,安装v1版本的awscli
1
2
brew uninstall awscli
brew install awscli@1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
==> Downloading https://ghcr.io/v2/homebrew/core/awscli/1/manifests/1.20.10
Already downloaded: /Users/Junxin/Library/Caches/Homebrew/downloads/75028ce994004c92af6e62b87f049ae457ab15d31a5c76678659fc0eb0e324a2--awscli@1-1.20.10.bottle_manifest.json
==> Downloading https://ghcr.io/v2/homebrew/core/awscli/1/blobs/sha256:4fe74c77019cd3ee34cf161f69048ab8805171e9d6236ecbf79482f12593fdf2
Already downloaded: /Users/Junxin/Library/Caches/Homebrew/downloads/73be8076212d9de63292764c90652162a78fd1f15d25ef4e411c8f18c53277bb--awscli@1--1.20.10.mojave.bottle.tar.gz
==> Reinstalling awscli@1
==> Pouring [email protected]
==> Caveats
The "examples" directory has been installed to:
/usr/local/share/awscli/examples

awscli@1 is keg-only, which means it was not symlinked into /usr/local,
because this is an alternate version of another formula.

If you need to have awscli@1 first in your PATH, run:
echo 'export PATH="/usr/local/opt/awscli@1/bin:$PATH"' >> ~/.zshrc


zsh completions and functions have been installed to:
/usr/local/opt/awscli@1/share/zsh/site-functions
==> Summary
🍺 /usr/local/Cellar/awscli@1/1.20.10: 11,559 files, 79.8MB
  1. 删除老的软链接,并根据安装v1的版本号(1.20.10)创建新的软链接。
1
2
rm /usr/local/bin/aws
ln -s /usr/local/Cellar/awscli@1/1.20.10/libexec/bin/aws /usr/local/bin/aws