在AzureML中使用Azure存储库 - 自定义python库

时间:2017-11-25 17:10:02

标签: python azure-storage azure-machine-learning-studio

我对Python不熟悉,所以我可能完全不了解如何将库正确导入到Azure ML中。

我有一堆数据存储在Table存储中,我有本地Python代码,可以成功地加入所有这些数据作为ML实验的准备。我了解到AzureML环境没有安装Azure-Storage库,因此根据this推出了上传包含我在anaconda3 \ lib \ site-packages下找到的Azure存储库的ZIP文件的步骤。我拿了所有azure目录并将它们推到一个zip文件下,然后在链接中的文档底部将zip文件作为DataSet上传,并将数据集附加到ML中的Execute Python脚本节点。

当我尝试运行节点时,我收到这样的错误:

requestId = 825883c7ccb74f7e869e68e60d3cd919 errorComponent=Module. taskStatusCode=400. e "C:\pyhome\lib\ssl.py", line 856, in send return self._sslobj.write(data) File "C:\pyhome\lib\ssl.py", line 581, in write return self._sslobj.write(data)socket.timeout: The write operation timed outDuring handling of the above exception, another exception occurred:Traceback (most recent call last): File "C:\pyhome\lib\site-packages\requests\adapters.py", line 376, in send timeout=timeout File "C:\pyhome\lib\site-packages\requests\packages\urllib3\connectionpool.py", line 609, in urlopen _stacktrace=sys.exc_info()[2]) File "C:\pyhome\lib\site-packages\requests\packages\urllib3\util\retry.py", line 247, in increment raise six.reraise(type(error), error, _stacktrace) File "C:\pyhome\lib\site-packages\requests\packages\urllib3\packages\six.py", line 309, in reraise raise value.with_traceback(tb) File "C:\pyhome\lib\site-packages\requests\packages\urllib3\connectionpool.py", line 559, in urlopen body=body, headers=headers) File "C:\pyhome\lib\site-packages\requests\packages\urllib3\connectionpool.py", line 353, in _make_request conn.request(method, url, **httplib_request_kw) File "C:\pyhome\lib\http\client.py", line 1083, in request self._send_request(method, url, body, headers) File "C:\pyhome\lib\http\client.py", line 1128, in _send_request self.endheaders(body) File "C:\pyhome\lib\http\client.py", line 1079, in endheaders self._send_output(message_body) File "C:\pyhome\lib\http\client.py", line 911, in _send_output self.send(msg) File "C:\pyhome\lib\http\client.py", line 885, in send self.sock.sendall(data) File "C:\pyhome\lib\ssl.py", line 886, in sendall v = self.send(data[count:]) File "C:\pyhome\lib\ssl.py", line 856, in send return self._sslobj.write(data) File "C:\pyhome\lib\ssl.py", line 581, in write return self._sslobj.write(data)requests.packages.urllib3.exceptions.ProtocolError: ('Connection aborted.', timeout('The write operation timed out',))During handling of the above exception, another exception occurred:Traceback (most recent call last): File "c:\temp\script bundle\azure\storage\storageclient.py", line 221, in _perform_request response = self._httpclient.perform_request(request) File "c:\temp\script bundle\azure\storage\_http\httpclient.py", line 114, in perform_request proxies=self.proxies) File "C:\pyhome\lib\site-packages\requests\sessions.py", line 468, in request resp = self.send(prep, **send_kwargs) File "C:\pyhome\lib\site-packages\requests\sessions.py", line 576, in send r = adapter.send(request, **kwargs) File "C:\pyhome\lib\site-packages\requests\adapters.py", line 426, in send raise ConnectionError(err, request=request)requests.exceptions.ConnectionError: ('Connection aborted.', timeout('The write operation timed out',))During handling of the above exception, another exception occurred:Traceback (most recent call last): File "C:\server\invokepy.py", line 199, in batch odfs = mod.azureml_main(*idfs) File "C:\temp\fa22884a19884f658d411dc0bdf05715.py", line 33, in azureml_main data = table_service.query_entities(table_name) File "c:\temp\script bundle\azure\storage\table\tableservice.py", line 728, in query_entities resp = self._query_entities(*args, **kwargs) File "c:\temp\script bundle\azure\storage\table\tableservice.py", line 795, in _query_entities operation_context=_context) File "c:\temp\script bundle\azure\storage\table\tableservice.py", line 1093, in _perform_request return super(TableService, self)._perform_request(request, parser, parser_args, operation_context) File "c:\temp\script bundle\azure\storage\storageclient.py", line 279, in _perform_request raise ex File "c:\temp\script bundle\azure\storage\storageclient.py", line 251, in _perform_request raise AzureException(ex.args[0])azure.common.AzureException: ('Connection aborted.', timeout('The write operation timed out',))Process returned with non-zero exit code 

我不确定我做错了什么

1 个答案:

答案 0 :(得分:0)

在Azure ML Studio中,Python脚本(以及R脚本)在沙箱中运行,因此无法通过网络访问资源。见limitations

  

Execute Python Script目前有以下限制:

     
      
  1. 沙盒执行。 Python运行时当前是沙箱的,如同   结果,不允许访问网络......
  2.   

因此,如果要从blob中读取,请使用单独的“导入数据”模块,如果要写入blob,请使用单独的“导出数据”模块。