我有这样的环境:
pip3 freeze | grep -i azure
azure==1.0.3
azure-batch==1.1.0
azure-common==1.1.4
azure-mgmt==0.20.2
azure-mgmt-common==0.20.0
azure-mgmt-compute==0.20.1
azure-mgmt-network==0.20.1
azure-mgmt-nspkg==1.0.0
azure-mgmt-resource==0.20.1
azure-mgmt-storage==0.20.0
azure-nspkg==1.0.0
azure-servicebus==0.20.1
azure-servicemanagement-legacy==0.20.2
azure-storage==0.33.0
msrestazure==0.4.4我试图在python中执行一个程序,其开头如下:
from azure.storage.blob import BlockBlobService,ContentSettings
block_blob_service = BlockBlobService("xxx","***")python输出此错误:
Traceback (most recent call last):
File "azure.py", line 1, in <module>
from azure.storage.blob import BlockBlobService,ContentSettings
File "/Users/dgonzalez/Proyectos/iloveplatos/git/back/app/azure.py", line 1, in <module>
from azure.storage.blob import BlockBlobService,ContentSettings
ImportError: No module named 'azure.storage'; 'azure' is not a package任何想法,我已经测试了其他版本,但我也有同样的问题。我在这一点上被堵住了。
谢谢!!
发布于 2016-10-22 17:46:42
看起来,您已经创建了自己的azure.py模块来干扰系统azure模块。给你的模块起别的名字。
发布于 2016-10-22 17:47:37
问题来自您的脚本/模块名为azure.py的名称。Python将其作为层次结构中的第一个导入。您应该将它重命名为其他东西,比如azure_deployment.py,以避免名称与Microsoft azure包发生冲突。
https://stackoverflow.com/questions/40195132
复制相似问题