donnemartin / saws

A supercharged AWS command line interface (CLI).
Other
5.23k stars 280 forks source link

'Namespace' object has no attribute 'cli_binary_format' #119

Open aberezin-acertus opened 4 years ago

aberezin-acertus commented 4 years ago

I am running saws under py3.6 under virtualenv with aws CLI2 (which I need for sso). I am getting the following error for any aws command I try: 'Namespace' object has no attribute 'cli_binary_format'

I tried explicitly setting that attribute in the default section of my .aws/config file but that doesn't help. Note that setting this attribute is a new feature of CLI2

keithknott26 commented 4 years ago

I'm also having this issue - bug in python or just incompatible with my python version?

image

cam8001 commented 4 years ago

Did you guys install version 2 of the aws cli using the packaged module?

https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html

It 'embeds' its own python according to the docs. I'm not sure how/if saws interacts with it.

domainoverflow commented 3 years ago

Same here.

plygrnd commented 3 years ago

This issue is also present in aws-shell, for the same reason. To fix this, both saws and aws-shell need to invoke the Python binary embedded in the CLI.

TRiggAtGM commented 2 years ago

This issue is also present in aws-shell, for the same reason. To fix this, both saws and aws-shell need to invoke the Python binary embedded in the CLI.

Is this guidance for how a SAWS user can resolve this issue, or is it guidance for how SAWS development can resolve this issue? If the former I'm not actually clear on what I can do as a SAWS user to get this rolling

jamnaughty commented 2 years ago

Have the same issue? Any fix for this?

jamnaughty commented 2 years ago

Solved using pip install -U awscli saws

billmetangmo commented 1 year ago

If you used to use pipx, to fix the issue you need one another command:

pipx install saws
pipx runpip saws install aws
anilkhichar commented 1 year ago

awscli-2 installed it's own python, hence below worked for me on MacOS:

/usr/local/Cellar/awscli/2.11.23/libexec/bin/pip install saws

Note: To find the awscli installed location, I used below:

brew info awscli | grep awscli
OR
brew info awscli | grep Cellar/awscli 
pegr69 commented 1 year ago

I have had this issue for several days now, turns out when I call aws cli from python somewhere along the line boto3 adds AWS_DATA_PATH to the env. This confuses aws cli and causes the issue, I just created a copy of the env and removed the AWS_DATA_PATH. problem sorted.

    env = os.environ
    # Remove injected invalid awsdatapath
    env.pop('AWS_DATA_PATH')

    os.execvpe('aws',['aws', 's3', 'ls'],env)