gpt4 book ai didi

python - 没有名为 'azure.storage.blob.sharedaccesssignature' 的模块

转载 作者:行者123 更新时间:2023-12-02 07:43:13 28 4
gpt4 key购买 nike

我已经在 Azure 库上苦苦挣扎了一段时间了。我想在 python 中使用 Azure。我已经安装了azure.storage.blob(通过pip install azure.storage.blob)。我已将其升级(也尝试卸载并重新安装)到版本 12.8.1。我目前运行的是 python 3.7.6。

尽管如此,我还是不断得到

from azure.storage.blob.sharedaccesssignature import BlobSharedAccessSignature

ModuleNotFoundError: No module named 'azure.storage.blob.sharedaccesssignature'

我在这里看到该模块:https://azure-storage.readthedocs.io/ref/azure.storage.blob.sharedaccesssignature.html

所以我不确定为什么它不被识别。有什么想法吗?

最佳答案

您收到此错误的原因是 BlobSharedAccessSignature 是旧版本 SDK ( azure-storage ) 的一部分,而您正在使用较新版本的 SDK ( azure.storage.blob version 12.8.1 )。

要在 blob 上生成共享访问签名,您需要使用新 SDK 中的 generate_blob_sas() 函数。

关于python - 没有名为 'azure.storage.blob.sharedaccesssignature' 的模块,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68341570/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com