How can certain python libraries be imported in azure ML?Like the line import humanfriendly gives error

随声附和 提交于 2019-11-28 14:04:26

问题


In execute python module. The line

import humanfriendly

gives error. How to fix this?


回答1:


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. 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.
  2. Then I click the botton +New and select the DATASET tab to Upload a new dataset from a local file, as the figures below.

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

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

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.


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


来源:https://stackoverflow.com/questions/44593469/how-can-certain-python-libraries-be-imported-in-azure-mllike-the-line-import-hu

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!