根据本手册,我应该使用这段代码:
from azure.storage.blob import ContentSettings
block_blob_service.create_block_blob_from_path(
'mycontainer',
'myblockblob',
'sunset.png',
content_settings=ContentSettings(content_type='image/png')
)
但是得到了这个错误:
AttributeError: 'BlockBlobService' object has no attribute 'create_block_blob_from_path'
尝试从git
,以及从pip
pip install azure-storage