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

1

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\Sergio.aws\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

sarzen
已提問 7 年前檢視次數 4176 次
2 個答案
2

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:
Link: http://docs.aws.amazon.com/cli/latest/userguide/cli-config-files.html

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.

sarzen
已回答 7 年前
0

Thank you for your reply really helped me!

Osi
已回答 3 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南