怎样才能在Azure ML中导入某些python库? [英] How can certain python libraries be imported in azure ML?Like the line import humanfriendly gives error

查看:90
本文介绍了怎样才能在Azure ML中导入某些python库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在执行python模块中.线

In execute python module. The line

import humanfriendly

给出错误. 该如何解决?

gives error. How to fix this?

推荐答案

您的描述不清楚,当您通过import humanfriendly遇到错误时,我不知道发生了什么.因此,我可以为您做的只是发布我的有关如何在Azure ML中安装humanfriendly Python程序包的步骤,如下所示.

Your description is not clear, I don't know what happended when you got error via import humanfriendly as you said. So I just can do for you that only post my steps about how to install humanfriendly Python package in Azure ML, as below.

  1. 根据部分 Technical Notes 文档"Execute Python Script",我从下载humanfriendly包这里.我解压缩了该程序包(对于 .whl 文件或 .tar.gz 文件),并将其humanfriendly目录打包为zip文件.

  1. According to the section Technical Notes of the document "Execute Python Script", I download the humanfriendly package from here. I decompressed the package (the same for either .whl file or .tar.gz file), and package its humanfriendly directory as a zip file.

然后单击botton +New,然后选择DATASET选项卡以从本地文件上传新数据集,如下图.

Then I click the botton +New and select the DATASET tab to Upload a new dataset from a local file, as the figures below.

图1.单击按钮+New 图2.选择选项卡DATASET 图3.从本地文件上传新的数据集

Fig 1. Click the botton +New Fig 2. Select the tab DATASET Fig 3. Upload a new dataset from a local file

拖动&删除数据集模块humanfriendly.zipExecute Python Script模块以连接它们并编写Python代码,如下所示.

Drag & drop the dataset module humanfriendly.zip and a Execute Python Script module to connect them and write the Python code, as below.

这是Execute Python Script中的我的测试代码.

Here is My testing code in the Execute Python Script.

import humanfriendly

def azureml_main(dataframe1 = None, dataframe2 = None):
    user_input = '16G'
    num_bytes = humanfriendly.parse_size(user_input)
    print num_bytes

最后,我成功进行了实验.

Finally, I ran the experiment successfully.

更新:我的humanfriendly zip的文件结构树.我解压缩了wheel文件,只打包了humanfriendly目录.

Update: The file structure tree of my humanfriendly zip. I decompressed the wheel file and just package the humanfriendly directory.

humanfriendly
├── data.csv
└── humanfriendly
    ├── cli.py
    ├── compat.py
    ├── __init__.py
    ├── prompts.py
    ├── sphinx.py
    ├── tables.py
    ├── terminal.py
    ├── tests.py
    ├── text.py
    └── usage.py

这篇关于怎样才能在Azure ML中导入某些python库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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