Boto3 Error: botocore.exceptions.NoCredentialsError: Unable to locate credentials

后端 未结 12 2241
逝去的感伤
逝去的感伤 2020-11-30 23:00

When I simply run the following code, I always gets this error.

s3 = boto3.resource(\'s3\')
    bucket_name = \"python-sdk-sample-%s\" % uuid.uuid4()
    pri         


        
12条回答
  •  渐次进展
    2020-11-30 23:54

    The boto3 is looking for the credentials in the folder like

    C:\ProgramData\Anaconda3\envs\tensorflow\Lib\site-packages\botocore\.aws
    

    You should save two files in this folder credentials and config.

    You may want to check out the general order in which boto3 searches for credentials in this link. Look under the Configuring Credentials sub heading.

提交回复
热议问题