亚马逊S3 - 无法创建数据源 [英] Amazon S3 - Unable to create a datasource
问题描述
我试着用博托机器学习创建数据源,但结束了一个错误。
这是我的code:
I tried creating a datasource using boto for machine learning but ended up with an error.
Here's my code :
import boto
bucketname = 'mybucket'
filename = 'myfile.csv'
schema = 'myfile.csv.schema'
conn = boto.connect_s3()
datasource = 'my_datasource'
ml = boto.connect_machinelearning()
#create a data source
ds = ml.create_data_source_from_s3(
data_source_id = datasource,
data_spec ={
'DataLocationS3':'s3://'+bucketname+'/'+filename,
'DataSchemaLocationS3':'s3://'+bucketname+'/'+schema},
data_source_name=None,
compute_statistics = True)
print ml.get_data_source(datasource,verbose=None)
我得到这个错误作为get_data_source调用的结果:
I get this error as a result of get_data_source call:
无法访问S3://mybucket/myfile.csv。则可能是在该位置没有文件,或者文件是空的,或者你还没有给了我们读取权限。
Could not access 's3://mybucket/myfile.csv'. Either there is no file at that location, or the file is empty, or you have not granted us read permission.
我检查,我有FULL_CONTROL我的权限。桶,文件和模式都是present且非空。 我该如何解决这个问题?
I have checked and I have FULL_CONTROL as my permissions. The bucket, file and schema all are present and are non-empty. How do I solve this?
推荐答案
您可以有 FULL_CONTROL
过了S3资源,但为了这个工作,你必须授予机器学习服务的适当访问该S3的资源。
You may have FULL_CONTROL
over that S3 resource but in order for this to work you have to grant the Machine Learning service the appropriate access to that S3 resource.
我知道链接到答案后,但在这种情况下,我认为最好链接到<一皱眉道href="http://docs.aws.amazon.com/machine-learning/latest/dg/creating_datasources.html#using-amazon-s3-with-amazon-ml"相对=nofollow>最终文件从机器学习服务因为实际的步骤复杂,并可能在未来改变。
I know links to answers are frowned upon but in this case I think its best to link to the definitive documentation from the Machine Learning Service since the actual steps are complicated and could change in the future.
这篇关于亚马逊S3 - 无法创建数据源的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!