繁体   English   中英

ImportError:没有名为azure.storage.blob的模块

[英]ImportError: No module named azure.storage.blob

我正在尝试使用以下代码通过python将文件从Azure下载到本地设备上:

from azure.storage.blob import BlockBlobService
block_blob_service = BlockBlobService(account_name='account_name', 
account_key='mykey')
block_blob_service.get_blob_to_path('container', 'file', 'out-test.csv')

但是,当我运行此代码时,出现以下错误:

ImportError: No module named azure.storage.blob

我已经安装了azure模块,如pip list输出的片段所示:

C:\Users\hpfc87>pip list
Package              Version
-------------------- ---------
adal                 0.6.0
asn1crypto           0.24.0
azure-common         1.1.11
azure-nspkg          2.0.0
azure-storage        0.36.0
azure-storage-blob   1.1.0
azure-storage-common 1.1.0
azure-storage-file   1.1.0
azure-storage-nspkg  3.0.0
azure-storage-queue  1.1.0

我尝试过以下有关此问题的各种帖子,但我没有运气:

ImportError:没有名为azure.storage.blob的模块(执行syncdb时)

https://github.com/Azure/azure-storage-python/issues/262

有什么建议吗?

仅作为总结,您的问题是由安装的python 2.7版本与Anaconda的python版本之间的冲突引起的。

您安装的软件包应该在python 2.7环境中。 但是,spyder使用的是Anaconda自带的python环境。

命令行使用系统python环境,该环境由path先前的python环境变量确定。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM