方法1 代码里加上key s3 = boto3.resource('s3', aws_access_key_id=ACCESS_ID, aws_secret_access_key= ACCESS_KEY) 方法2 添加环境变量: # mac和linux export AWS_SECRET_ACCESS_KEY="XXXXXXXXXXXX" export AWS_ACCESS_KEY_ID="XXXXXXXXXXX" 方法3<