Azure ML执行Python模块:禁用网络I/O? [英] Azure ML Execute Python Module: Network I/O Disabled?

查看:56
本文介绍了Azure ML执行Python模块:禁用网络I/O?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

没有办法从azure ml连接到URL并获取其内容

Is there no way to connect to a URL from azure ml and get it's content

我的代码:

import requests
def azureml_main(dataframe1 = None, dataframe2 = None):    
    b= requests.get("http://www.google.com",timeout=30)
    dataframe1 = b.content
    return dataframe1

是否需要进行任何更改以连接到URL

Is there any change need to be made to connect to URL

错误:

Error 0085: The following error occurred during script evaluation, please view the output log for more information:
 ---------- Start of error message from Python interpreter ----------
data:text/plain,Caught exception while executing function: Traceback (most recent call last):
File "C:\server\invokepy.py", line 167, in batch
odfs = mod.azureml_main(*idfs)
File "C:\temp\azuremod.py", line 24, in azureml_main
b= requests.get("http://www.google.com",timeout=30)
File "C:\pyhome\lib\site-packages\requests\api.py", line 55, in get
return request('get', url, **kwargs)
File "C:\pyhome\lib\site-packages\requests\api.py", line 44, in request
return session.request(method=method, url=url, **kwargs)
File "C:\pyhome\lib\site-packages\requests\sessions.py", line 456, in request
resp = self.send(prep, **send_kwargs)
File "C:\pyhome\lib\site-packages\requests\sessions.py", line 559, in send
r = adapter.send(request, **kwargs)
File "C:\pyhome\lib\site-packages\requests\adapters.py", line 375, in send
raise ConnectionError(e, request=request)
ConnectionError: HTTPConnectionPool(host='www.google.com', port=80): Max retries exceeded with url: / (Caused by <class 'socket.gaierror'>: [Errno 11001] getaddrinfo failed)

---------- End of error message from Python  interpreter  ---------

还是需要对天蓝色ml设置进行任何更改

Or is there any change needed to be made on the azure ml settings

推荐答案

UPDATE 2016年1月8日

UPDATE 1/28/2016

用于 Execute Python脚本的网络I/O.

已过期

执行Python模块"不支持网络I/O.为了执行这样的程序,您应该改为启动虚拟机(您选择的Windows或Linux).

Network I/O is not support from Execute Python Modules. In order to execute such a program, you should instead launch a virtual machine(Windows or Linux your choice).

Windows:

  1. RDP进入虚拟机
  2. 安装您选择的Python
  3. 您可以将Python程序从本地Windows计算机拖放到RDP屏幕上以传输代码
  4. 然后运行程序

Ubuntu:

  1. 使用Cygwin或Putty(Windows)或Terminal SSH(mac)SSH进入您的虚拟机 ssh yourUserName@yourAzureVM.cloudapps.net
  2. 安装Python sudo apt-get安装python
  3. 打开您首选的Linux文本编辑器 vi myProgram.py
  4. 将代码复制并粘贴到编辑器中(将vi与esc :wq 保留在一起)
  5. 运行您的代码 python myProgram.py
  1. SSH into your virtual machine using Cygwin or Putty(Windows) or Terminal SSH (mac) ssh yourUserName@yourAzureVM.cloudapps.net
  2. install Python sudo apt-get install python
  3. open your preferred Linux text editor vi myProgram.py
  4. Copy and Paste your code into the editor (leave vi with esc :wq )
  5. Run your code python myProgram.py

要将数据从VM迁移到AzureML,请查看 Azure-MachineLearning-ClientLibrary-Python 在Github上

To move data from your VM to AzureML please check out the Azure-MachineLearning-ClientLibrary-Python on Github

这篇关于Azure ML执行Python模块:禁用网络I/O?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆