2017-09-14 33 views
1

我真的很想访问pandas 0.19中的某些更新函数,但Azure ML studio使用pandas 0.18作为Anaconda 4.0包的一部分。有没有办法更新“Execute Python Script”组件中使用的版本?在Azure ML Studio中将pandas更新至0.19版

+0

您使用的是Anaconda 4.0中的Python版本? 2.7还是3.5? –

+0

Python version 3.5 – user4446237

+0

Hi.Any progress?我的答案对你有帮助吗? –

回答

1

我提供以下步骤供您展示如何更新Execute Python Script中熊猫库的版本。

步骤1:使用virtualenv组件来创建你的system.Please一个独立的Python运行时环境命令pip install virtualenv先安装它,如果你没有它。

如果你安装成功,你可以在你的python/Scripts文件中看到它。

enter image description here

第二步:运行commad创建独立的Python运行时环境。

enter image description here

步骤3:然后进入创建的目录的Scripts文件夹并激活它(这一步是很重要的,千万不要错过哦)

请不要关闭这个命令窗口并使用pip install pandas==0.19在此命令窗口中下载外部库。

enter image description here

步骤4:压缩所有在lib /站点包中的文件文件夹成一个zip包(我叫它大熊猫 - 包在这里)

enter image description here

第5步:将zip包上传到Azure机器学习WorkSpace数据集中。

enter image description here

具体步骤请参考Technical Notes

成功后,你会看到上传的包中的数据集列表

enter image description here

步骤6:方法azureml_main的执行Python脚本模块中的认定中之前,你需要删除老pandas模块&其依赖关系,然后再次导入pandas,如下面的代码。

import sys 
import pandas as pd 
print(pd.__version__) 
del sys.modules['pandas'] 
del sys.modules['numpy'] 
del sys.modules['pytz'] 
del sys.modules['six'] 
del sys.modules['dateutil'] 
sys.path.insert(0, '.\\Script Bundle') 
for td in [m for m in sys.modules if m.startswith('pandas.') or m.startswith('numpy.') or m.startswith('pytz.') or m.startswith('dateutil.') or m.startswith('six.')]: 
    del sys.modules[td] 
import pandas as pd 
print(pd.__version__) 
# The entry point function can contain up to two input arguments: 
# Param<dataframe1>: a pandas.DataFrame 
# Param<dataframe2>: a pandas.DataFrame 
def azureml_main(dataframe1 = None, dataframe2 = None): 

然后你就可以从日志中看到的结果如下,首先打印旧版本0.14.0,然后从上传的zip文件打印新版本0.19.0

[Information]   0.14.0 
[Information]   0.19.0 

您也可以参考这些线程:Access blob file using time stamp in Azurereload with reset

希望它可以帮助你。

+0

@ user4446237有何进展? –

0

Azure机器学习工作台允许使用Docker设置环境更灵活。我转向使用该工具。

相关问题