簡體   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