0

I'm getting and error "Anonymous access is forbidden for this operation" when trying to use the df.to_csv function.

df.to_csv("s3://testdatateam1/test6.csv",
          storage_options={'key': 'key here',
                           'secret': 'secret here})

I've been able to use boto3 to read and write files from local using these credentials, and also a session token. But I need to write files from a pandas dataframe. I did read that pandas uses boto not boto3 which I also have imported.

Any help would be greatly appreciated!

Parry Chen
  • 13
  • 2
  • 1
    Have you tried something like [this answer](https://stackoverflow.com/a/40615630/530160) ? – Nick ODell Mar 02 '23 at 20:58
  • @NickODell I have but I'm getting "Unable to locate credentials". I have my credentials like this client = boto3.client('s3', aws_access_key_id='', aws_secret_access_key='', aws_session_token='') – Parry Chen Mar 02 '23 at 21:17

0 Answers0