Skip to content

Update docs: Use no_sign_request to fix "NoCredentials" Error when trying to access a public S3 bucket #271

@torrinworx

Description

@torrinworx

I've outlined this issue in more depth here: https://stackoverflow.com/q/73708204/15739035

But essentially just using this simple code:

from cloudpathlib import CloudPath
path = r"C:\some\path\to\folder"
url = "s3://some-example-bucket/folder/"

cloud_path = CloudPath(url)
cloud_path.download_to(path)

I'm unable to download a folder from this S3 bucket: s3://cozy-auto-texture-sd-repo/stable-diffusion-v1-4/

Now this bucket needs to be public so I can distribute a repository to my users, and anyone needs to be able to access it. For some reason whenever I run the above code with that s3:// link, cloudpathlib gives the following error:

  File "E:\Cozy-Auto-Texture-Files\venv\lib\site-packages\botocore\auth.py", line 418, in add_auth
    raise NoCredentialsError()
botocore.exceptions.NoCredentialsError: Unable to locate credentials

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions