我得到了一个
from azure.storage.blob import BlobServiceClient
不过,我意识到,当我将依赖项安装为
pip install azure-storage-blob
pip install azure-storage
但当我像这样安装它们时就不行了
pip install azure-storage
pip install azure-storage-blob
pip freeze
在这两种情况下显示相同的库
azure-common==1.1.23
azure-core==1.0.0
azure-nspkg==3.0.2
azure-storage==0.36.0
azure-storage-blob==12.0.0
certifi==2019.9.11
cffi==1.13.2
chardet==3.0.4
cryptography==2.8
idna==2.8
isodate==0.6.0
msrest==0.6.10
oauthlib==3.1.0
pycparser==2.19
python-dateutil==2.8.1
requests==2.22.0
requests-oauthlib==1.3.0
six==1.13.0
urllib3==1.25.7
第二种方法是有效的,但是我担心以后会出现错误。 Azure库有问题吗?或者我在这里遗漏了什么?你知道吗
请卸载
azure-storage-blob
和azure-storage
。你知道吗然后使用以下命令:
BlobServiceClient
位于latest version 12.0.0 of azure-storage-blobazure存储包已弃用。你知道吗
请用这些包裹
https://pypi.org/project/azure-storage-blob/
https://pypi.org/project/azure-storage-queue/
https://pypi.org/project/azure-storage-file-share/
pip install azure-storage-blob
就足够了,不需要安装azure-storage
。你知道吗同样,如果正在处理队列和文件,请安装它们。 如果您仍然面临这个问题,请告诉我(我为azure sdk团队工作)
正如@GauravMantri所说,如果您想使用} 包,因为包} 不同,但它们使用相同的名称空间作为前缀。你知道吗
from azure.storage.blob import BlobServiceClient
,您只需安装^{azure-storage-blob
与^{所以不同的安装顺序会得到不同的结果。例如,如下所示。你知道吗
后面的包
azure-storage
安装将覆盖示例名称空间azure.storage.blob
,但不包括类BlobServiceClient
,只包括azure-storage
的类BlockBlobService
。你知道吗作为参考,GitHub repo^{} 的
README.md
也注意到如下图所示,当您想要使用azure-storage-blob
时,必须首先卸载azure-storage<=0.36.0
。你知道吗因此,如果使用这些包的不正确安装顺序作为示例,则必须首先卸载
azure-storage
,然后安装azure-storage-blob
再次避免以后可能出现的错误。你知道吗相关问题 更多 >
编程相关推荐