我正在尝试改编亚马逊SageMaker上的开源项目mmfashion,它需要后端的CEPH模块。不幸的是,pip install ceph不能工作。唯一的解决方法是通过在我的容器中运行来手动构建ceph source-code:
!git clone git://github.com/ceph/ceph
!git submodule update --init --recursive这确实允许我成功地导入ceph。但当涉及到从亚马逊S3获取数据时,它会抛出以下错误:
AttributeError: module 'ceph' has no attribute 'S3Client'是否有人将CEPH与亚马逊S3 Bucket集成在一起,或者对如何解决这一问题提出了建议?
发布于 2021-02-17 04:23:10
您可以使用ceph python api连接到S3存储桶,以下是连接任何S3 api的简单python示例脚本:
import boto
import boto.s3.connection
access_key = 'put your access key here!'
secret_key = 'put your secret key here!'
conn = boto.connect_s3(
aws_access_key_id = access_key,
aws_secret_access_key = secret_key,
host = 'objects.dreamhost.com',
#is_secure=False, # uncomment if you are not using ssl
calling_format = boto.s3.connection.OrdinaryCallingFormat(),
)然后,您将能够列出存储桶:
for bucket in conn.get_all_buckets():
print "{name}\t{created}".format(
name = bucket.name,
created = bucket.creation_date,
)https://stackoverflow.com/questions/66200436
复制相似问题