【发布时间】:2017-01-01 19:40:57
【问题描述】:
我正在尝试使用 boto 将 ~46Gb 文件的大文件从 EMR 上传到 S3。 我写的代码是
>>> import math, os
>>> import boto
>>> from filechunkio import FileChunkIO
# Connect to S3
>>> c = boto.connect_s3()
>>> b = c.get_bucket('mybucket')
这是给我的错误:
UnboundLocalError: local variable 'region_name' referenced before assignment
您可以在以下链接中找到相同错误的整个堆栈:
https://github.com/boto/boto/issues/2624
谁能告诉我这个问题的解决方法是什么?
【问题讨论】:
-
哪一行报错了?您的凭据可能存在问题 - 在
try块中缩进 boto 方法并打印任何异常消息。 -
b = c.get_bucket('mybucket') 抛出错误。我还没有交出证件。我正在访问的存储桶是公共存储桶。
标签: python amazon-web-services amazon-ec2 boto emr