1
from boto.s3.connection import S3Connection
AWS_KEY = 'abc'
AWS_SECRET = 'xyz'
print AWS_KEY
print AWS_SECRET
aws_connection = S3Connection(AWS_KEY, AWS_SECRET)
print aws_connection
#Create the bucket in a specific region.
bucket = aws_connection.create_bucket('mybucket0005',location='us-west-2')
這段代碼我運行創造桶;但得到以下錯誤,AWS S3文件來自Python的
Traceback (most recent call last):
File "<ipython-input-63-f14efbf83dc6>", line 16, in <module>
bucket = aws_connection.create_bucket('mybucket0005',location='us-west-2')
File "/usr/local/lib/python2.7/dist-packages/boto/s3/connection.py", line 625, in create_bucket
response.status, response.reason, body)
S3ResponseError: S3ResponseError: 403 Forbidden
<?xml version="1.0" encoding="UTF-8"?>
<Error><Code>InvalidAccessKeyId</Code><Message>The AWS Access Key Id you provided does not exist in our records.</Message>
<AWSAccessKeyId>abc</AWSAccessKeyId><RequestId>930E9DC30F239D11</RequestId><HostId>xlaLEeS7C4KYgLOKOShF9uGhLgM+4OdFYiLGn7F5JvKty38kAir5vSNSDH7q5TWFPO/6BEjeHaA=</HostId></Error>
我想從Python.Help訪問AWS S3文件我出去。
access_key = 'AKIAIOSFODNN7EXAMPLE' SECRET_KEY = 'wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY' 我用這一個only..still得到同樣的錯誤。 –
誠實地_EXAMPLE_在您的access_key中,我不是說它不會發生,但我真的懷疑,不要從網上的某個地方拿走它,將它從您的帳戶中拿走 –
現在我只從我的帳戶使用正確的訪問密鑰。 現在它顯示這個錯誤:(在創建桶) 加薪前 gaierror:[錯誤-2]產品名稱或服務不知道 –