如何导入" scikit-multilearn" Azure机器学习中的python库

时间:2017-12-20 12:43:14

标签: python azure scikit-multilearn

  1. 我们正在尝试导入" scikit-multilearn" python中的库 脚本,我们在Azure机器学习中使用此python脚本 算法实现我们的目标。

    我们已经在jupyter笔记本中编写了我们的脚本并运行了我们的脚本 算法中的脚本。

    在运行python脚本时我们遇到错误,

      

    ImportError Traceback(最近一次调用   最后)in()   ----> 1来自skmultilearn.problem_transform import LabelPowerset         2

         

    ImportError:没有名为' skmultilearn'

    的模块

    需要帮助才能获得解决方案。

  2. 编辑:

    我们已经按照上面提到的步骤成功完成了。有关详情,请参阅下图。 enter image description here

    但是在添加DataSet List之后,将其拖到第三个节点 在机器学习实验中执行Python脚本,我们运行它 它会引发以下错误:

    Error 0085: The following error
    occurred during script evaluation, please view the output log for
    more information:
    
    ---------- Start of error message from Python interpreter ---------- Caught exception while executing function: Traceback (most recent
    call last):   File "C:\server\invokepy.py", line 189, in batch
        mod = import_module(moduleName)   File "C:\pyhome\lib\importlib\__init__.py", line 37, in import_module
        __import__(name)   File "C:\temp\f99d826a21174a1a87b0dfd39e10fcb5.py", line 16, in <module>
        from skmultilearn.adapt import MLkNN ImportError: No module named skmultilearn.adapt Process returned with non-zero exit code 1
    
    ---------- End of error message from Python  interpreter  ---------- Start time: UTC 12/21/2017 07:26:59 End time: UTC 12/21/2017 07:27:13
    

    另外,我们只是写了“来自skmultilearn.adapt import MLkNN“用于检查库导入的python脚本中的语句。

    enter image description here

1 个答案:

答案 0 :(得分:0)

  

ImportError:没有名为&#39; skmultilearn&#39;

的模块

您似乎没有成功导入scikit-multilearn包。

我提供以下步骤,以便您在skmultilearn中展示如何导入Execute Python Script个包。

第1步 :使用virtualenv组件在系统中创建独立的python运行时环境。请先使用命令pip install virtualenv安装它如果你没有它。

enter image description here

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

enter image description here

<强> 步骤2 :运行commad创建独立Python运行时环境

enter image description here

第3步 :然后进入创建目录的Scripts文件夹并激活它(这一步很重要,不要错过)< / p>

enter image description here

请不要关闭此命令窗口并使用pip install scikit-multilearn在此命令窗口中下载外部库。

enter image description here

第4步 :将Lib / site-packages文件夹中的所有文件压缩成zip包(我称之为scikit-multilearn- package这里)

enter image description here

第5步 :将zip包上传到Azure机器学习工作空间数据集。

enter image description here

具体步骤请参阅Technical Notes

成功后,您将在DataSet列表中看到上传的包

enter image description here

第6步 :成功后,您将在DataSet列表中看到上传的包,将其拖至执行的第三个节点 Python脚本。

![enter image description here

希望它对你有所帮助。