saws icon indicating copy to clipboard operation
saws copied to clipboard

'Namespace' object has no attribute 'cli_binary_format'

Open aberezin-acertus opened this issue 6 years ago • 10 comments

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

aberezin-acertus avatar Mar 23 '20 21:03 aberezin-acertus

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

image

keithknott26 avatar Apr 22 '20 09:04 keithknott26

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.

cam8001 avatar Apr 25 '20 10:04 cam8001

Same here.

domainoverflow avatar Mar 05 '21 20:03 domainoverflow

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.

plygrnd avatar Jun 23 '21 12:06 plygrnd

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

TRiggAtGM avatar Sep 30 '21 16:09 TRiggAtGM

Have the same issue? Any fix for this?

jamnaughty avatar Feb 09 '22 21:02 jamnaughty

Solved using pip install -U awscli saws

jamnaughty avatar Feb 09 '22 21:02 jamnaughty

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

pipx install saws
pipx runpip saws install aws

billmetangmo avatar Oct 27 '22 09:10 billmetangmo

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 

anilkhichar avatar May 30 '23 11:05 anilkhichar

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)

pegr69 avatar Aug 24 '23 06:08 pegr69