aws-shell
aws-shell copied to clipboard
Support AWS CLI v2
Hello,
When using AWS CLI v2, I get this error: 'Namespace' object has no attribute 'cli_binary_format'
On Windows 10, Python 3.8.1
AWS CLI v2 reference: https://aws.amazon.com/blogs/developer/aws-cli-v2-is-now-generally-available/
Thanks!
I have same issue. After update aws-cli, aws-shell does not works.
Environment: os: macOS 10.15.3 awscli: aws-cli/2.0.0 Python/3.8.1 Darwin/19.3.0 botocore/2.0.0dev4 (installed by homebrew) aws-shell: 0.2.1 (installed by homebrew)
Same problem for me on macOS and with awscli
installed via Homebrew:
$ aws --version
aws-cli/2.0.0 Python/3.8.2 Darwin/19.3.0 botocore/2.0.0dev7
If I use the pip
installed module it works without issues:
$ python3 -m awscli --version
aws-cli/1.18.20 Python/3.7.7 Darwin/19.3.0 botocore/1.15.20
Is this project abandoned?
Even I am facing the same issue. Environment OS - macOS 10.15.4 AWS - aws-cli/2.0.8 Python/3.8.2 Darwin/19.4.0 botocore/2.0.0dev12
Do we have plans to maintain this? I was relying holistically on this until cli 2.0 happened 😐
Any idea how to fix it? Run any command got this error.
$ aws-shell Creating doc index in the background. It will be a few minutes before all documentation is available. aws> configure
'Namespace' object has no attribute 'cli_binary_format'
Encountered the same problem. I am running WSL 18.04
I solved it by upgrading both the awscli
and aws-shell
together via pip
pip install -U awscli aws-shell
Hope this can be helpful for other people.
Encountered the same problem. I am running WSL 18.04
I solved it by upgrading both the
awscli
andaws-shell
together viapip
pip install -U awscli aws-shell
Hope this can be helpful for other people.
It fixed the issues. Thanks Xinbin!
I solved it by upgrading both the
awscli
andaws-shell
together viapip
That's perhaps because pip install awscli
installs awscli
v1 (1.18.69 as of today)
- https://pypi.org/project/awscli/
Encountered the same problem. I am running WSL 18.04
I solved it by upgrading both the
awscli
andaws-shell
together viapip
pip install -U awscli aws-shell
Hope this can be helpful for other people.
Did not work for me.
I ran into this same issue, unfortunately, and as stated by someone else it appears as though installing both the awscli
and the aws-shell
together would not work because that would not currently install the awscli
v2. I am on Arch Linux and I installed the awscli
via these steps.
Did not work also on Win10 Arch and awscli v2. Anyone who have the same problem
I am experiencing the same. By the look at this repository, all development was done in mid 2016 with some contributions in 2018, so I guess it is safe to assume that this project died (unless someone picks it up)
Managed to get aws-shell
running ok in a fresh virtual environment using:
aws-shell==0.2.1
awscli==1.18.91
Suspect this is related to AWS CLI version 2
I am also facing the same issue. I am unable to perform any actions. I always get 'Namespace' object has no attribute 'cli_binary_format'
I am using:
AWS CLI Version: aws-cli/2.0.19 Python/3.7.7 Windows/10 botocore/2.0.0dev23
Encountered the same problem. I am running WSL 18.04
I solved it by upgrading both the
awscli
andaws-shell
together viapip
pip install -U awscli aws-shell
Hope this can be helpful for other people.
This worked for me, thanks a lot.
Encountered the same problem. I am running WSL 18.04 I solved it by upgrading both the
awscli
andaws-shell
together viapip
pip install -U awscli aws-shell
Hope this can be helpful for other people.
This worked for me, thanks a lot.
I have tried but it does not work. AWS CLi reverts back to 1.x version Could you check again if you are running now 2.0 in awscli.
aws --version
Hi Guys,
After reading the information from this thread, I guess the root cause is awscli version conflict; aws-shell believes that you are using awscli version 1 that cli_binary_format is not supported; your system has both 2 versions and the command is executed with awscli version 2 which cli_binary_format could be mandatory.
The solution is cleaning up all version of awscli and aws-shell in your system, then reinstall them. That solved my issue.
Good luck, Kent
What are your installation commands for re-installing. Still Ihave no luck
I have same problem on macOS v10.15.6.
[ chusiang@catalina ~ ] - 17:20
$ brew install awscli
[ chusiang@catalina ~ ] - 17:39
$ aws --version
aws-cli/2.0.33 Python/3.8.5 Darwin/19.5.0 botocore/2.0.0dev37
I will use the aws-shell
command via Docker, I give up to fix this problem now. 😂
https://hub.docker.com/r/pahud/aws-shell
[ chusiang@catalina ~ ] - 17:49
$ docker run -it --rm -v $HOME/.aws:/root/.aws pahud/aws-shell
First run, creating autocomplete index...
Creating doc index in the background. It will be a few minutes before all documentation is available.
aws> s3 ls
2020-06-27 15:15:25 fooooooo
aws>
By the way, I also add one alias to disguise the aws-shell
command.
$ echo "alias aws-shell='docker run -it --rm -v $HOME/.aws:/root/.aws pahud/aws-shell'" >> ~/.bash_aliases
Thanks for @pahud .
Is this project abandoned or not?
Thanks @chusiang. Since I'm using aws-vault to store my Access Keys/Secret Keys instead of ~/.aws/credentials, I improved your alias by passing AWS_* environment variables to the container, and turned it into a wrapper script:
#!/bin/bash
function cleanup() {
rm "${env_file}"
}
trap cleanup EXIT
env_file=$(mktemp)
env | grep ^AWS_ > "${env_file}"
docker run -it --rm -v $HOME/.aws:/root/.aws --env-file="${env_file}" pahud/aws-shell
I fixed in Win10 by selecting in my PATH the AWS CLI v1.x. C:\Program Files\Amazon\AWSCLI
AWS CLI V2.x uses C:\Program Files\AWSCLIV2
So how do we get support for AWS CLI V2.x?
you can fix with installing awscli@1 and changing your path:
brew install awscli@1 echo 'export PATH="/usr/local/opt/awscli@1/bin:$PATH"' >> ~/.zshrc
(change zshrc to whatever your shell is...)
After reading the information from this thread, I guess the root cause is awscli version conflict; aws-shell believes that you are using awscli version 1 that cli_binary_format is not supported; your system has both 2 versions and the command is executed with awscli version 2 which cli_binary_format could be mandatory.
The solution is cleaning up all version of awscli and aws-shell in your system, then reinstall them. That solved my issue.
Hi Guys,
Please allow me to elaborate a bit what happened in macOS environment.
- Brew will install awscli v2 and a bunch of other components, including python 3, to /usr/local/Cellar. And create system links in /usr/local/bin etc.
- When using pip to install aws-shell, awscli (only v1 is available at the monment) etc., they will be installed in somewhere like $YOUR_PYTHON_HOME/3.8.5/lib/python3.8/site-packages.
- When executing aws --version, depends on your $PATH setting because your system have got 2 versions of awscli now, the system could use the version installed via brew. That's why you see version 2.x.x printed.
- When executing aws-shell, the aws-shell will load the awscli module installed within the same site-packages, which is awscli v1. That means aws-shell believes that he is interacting with version 1, thus he should not use cli_binary_format parameter.
- However, when you execute any aws command in aws-shell, e.g. s3 ls, aws-shell will call aws command to do the job. Now, please refer to #3 above. That means the aws-shell could be calling the awscli version 2 which requires the cli_binary_format parameter. That's why the 'Namespace' object has no attribute 'cli_binary_format' error occurred.
tips: execute sudo find / -name python to see where they are.
Gook luck, Kent
still hopeful that aws-shell
isn't going away anytime soon and gets support for AWS CLI v2 ❤️
in the meantime based other examples given here I too have resorted to just using a docker container for aws-shell
and have aws-vault
handling auth by passing in an --env-file
directly:
alias aws-shell-prod="docker run -it --rm -v $HOME/.aws:/root/.aws -v $PWD:/workspace --env-file <(aws-vault exec production -- env | grep ^AWS_) -w /workspace pahud/aws-shell"
thanks to @pahud @chusiang @dserodio
AWS have added auto-prompt mode to CLI v2, so aws-shell is not required unless you still need v1. See https://github.com/aws/aws-cli/issues/5664
Here is my solution and hopefully it will work. The issue in my case arises because of aws-shell in a different directory
Note- When we installed any package via HomeBrew, it put the package inside the .linuxbrew (hidden directory) which is separate from your $HOME dir.
See the image below.
Step1: Find the aws-shell directory via which aws-shell (In my case it was inside this /home/linuxbrew/.linuxbrew/bin earlier)
Step2: Once you find the directory, prefer to create a folder where you can put all the packages together. That can either be in /usr/bin or create your own ( In my case I put inside the /usr/local/bin)
You can see I've got a bunch of other packages such as Ansible, terraform etc.
Step3: For Ubuntu users, find your .bashrc file and provide the path into it. Similar, other operating systems (such as windows, mac etc) can find their shell-script file and add the path.
(Additional Note- .bashrc is a shell script that Bash runs whenever it is started interactively. It initializes an interactive shell session. You can put any command in that file that you could type at the command prompt. )
Don't forget to reload the .bashrc. To run refresh the .bashrc file, simply go to your $HOME yourterminal~$ . .bashrc (run dot-space-dotbashrc)
Voila it's working 👍🏻
Hope this helps :)
same issue windows keeps reverting cli back to v1
I am happy with v2's auto-prompt mode as described at https://github.com/aws/aws-cli/issues/5664
export AWS_CLI_AUTO_PROMPT=on
aws # This will immediately enter auto-prompt mode