2017-09-14 34 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設置環境更靈活。我轉向使用該工具。

相關問題