繁体   English   中英

部署时在azure笔记本中出现错误:ImportError:没有名为azure.storage.blob的模块

[英]Getting error in azure notebooks while deploying : ImportError: No module named azure.storage.blob

我们使用azure ml stodio工作区,并尝试使用ml studio中存在的azure笔记本部署模型。

使用以下代码导入了azure-storage。

!pip install azure-storage==0.36.0

当我在本地运行时它可以工作,但是当它部署到ML studio工作区时,它给了我们这个错误:

{u'error':{u'message':u'Module执行遇到错误。',u'code':u'ModuleExecutionError',u'details':[{u'message':u'Error 0085:The在脚本评估期间发生以下错误,请查看输出日志以获取更多信息:\\ r \\ n ----------来自Python解释器的错误消息开始---------- \\ r \\ n执行函数时捕获到异常:追溯(最近一次调用):\\ n executeScript中的第120行“ \\ server \\ InvokePy.py” \\ n outframe = mod.azureml_main(* inframes)\\ n文件“ \\ temp \\ 1450604638” .py“,第1094行,在azureml_main \\ n results.append(__ user_function(client_code))\\ n文件”“,第17行,在final_model \\ n文件”“,第5行,在data_input \\ nImportError:没有名为Azure的模块。 storage.blob \\ n \\ r \\ n \\ r \\ n ----------来自Python解释器的错误消息结束----------',u'code':u'85 ',u'target':u'执行Python脚本RRS'}]}}

用于部署的代码:

from azureml import Workspace
ws = Workspace()
workspace_id = 'xxxxx'
authorization_token = 'yyyyyy'

from azureml import services
@services.publish(workspace_id, authorization_token)
@services.types(client_code = int)
@services.returns(int)

def final_model(client_code):
import pandas as pd
data_input(account_name,key) # this function has code related to importing data from blob
return client_code

service_url = final_model.service.url
api_key = final_model.service.api_key
help_url = final_model.service.help_url
service_id = final_model.service.service_id

ML studio工作区中用于从blob导入数据以使其在其中部署时运行的包名称是什么。

我建议您通读本文档中的安装依赖项

运行bellow命令可以解决依赖关系/缺少模块,但是,此程序包与azure-storage不兼容。 如果您安装了azure-storage,或者安装了azure 1.x / 2.x并且没有卸载azure-storage,则必须先卸载azure-storage

pip install azure

可以在此处找到有关上述命令的更多详细信息

暂无
暂无

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

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