By using AWS re:Post, you agree to the Terms of Use

Can't start latest AWS CLI on Windows (malformed path to config file)


I've just just installed the latest AWS CLI x64 on Windows 10, from file AWSCLI64.msi . Then I have set the PATH variable as required.
When I launch aws, I get the following error:

C:\Users\Sergio>aws --version
Traceback (most recent call last):
  File "aws", line 27, in <module>
  File "aws", line 23, in main
  File "awscli\clidriver.pyc", line 55, in main
  File "awscli\clidriver.pyc", line 63, in create_clidriver
  File "botocore\session.pyc", line 386, in full_config
  File "botocore\configloader.pyc", line 152, in raw_config_parse
botocore.exceptions.ConfigParseError: Unable to parse config file: C:\Users\Sergio/.aws/credentials

The last line clearly suggests the cause, as the path to credentials file is malformed for Windows: C:\Users\Sergio/.aws/credentials
indeed, it should be: C:\Users\\credentials

Hence, I've set the env variable AWS_CREDENTIAL_FILE=C:\Users\Sergio\.aws\credentials , then opened a new cmd.exe window, but I still get the same error.

I've also tried the command:

aws configure

but the same error occurs too. It seems aws.exe cannot start in any way on Windows.

What should I do ?
(and please, let AWS fix this bug !)

Tags: cli windows configparseerror

asked 5 years ago738 views
2 Answers

I have just discovered that the error is due to an invalid format of .aws\credentials file content.
It can be solved by editing the file and placing there proper credentials, following the format shown here:

Anyway, to get a useful tip which addressed me to the resolution, I had to uninstall AWSCLI from its MSI installer package and then reinstall it using pip:

pip install awscli --upgrade --user

After some more troubleshoot of PATHs, I ran aws again and I got a more meaningful error message, which addressed me to the resolution above.

answered 5 years ago

Thank you for your reply really helped me!

answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions