python - 在 Azure ML 中安装 Python 包?

标签 python azure azure-machine-learning-service cvxpy

类似的问题here但现在在 Python 包上。目前,Azure ML 中缺少 CVXPY。我还尝试让其他求解器(例如 GLPK、CLP 和 COINMP)在 Azure ML 中工作。

如何在 Azure ML 中安装 Python 包?

<小时/>

有关尝试安装 Azure ML 中未找到的 Python 包的更新。

I did as instructed by Peter Pan but I think the 32bits CVXPY files are wrong for the Anaconda 4 and Python 3.5 in Azure ML, logs and errors are here.

[Information]         Running with Python 3.5.1 |Anaconda 4.0.0 (64-bit)| (default, Feb 16 2016, 09:49:46) [MSC v.1900 64 bit (AMD64)]

enter image description here

enter image description here

enter image description here

使用 win_amd64 文件更新 2(粘贴 here )

[Information]         Extracting Script Bundle.zip to .\Script Bundle
[Information]         File Name                                             Modified             Size
[Information]         cvxopt-1.1.9-cp35-cp35m-win_amd64.whl          2017-06-07 01:03:34      1972074
[Information]         __MACOSX/                                      2017-06-07 01:26:28            0
[Information]         __MACOSX/._cvxopt-1.1.9-cp35-cp35m-win_amd64.whl 2017-06-07 01:03:34          452
[Information]         cvxpy-0.4.10-py3-none-any.whl                  2017-06-07 00:25:36       300880
[Information]         __MACOSX/._cvxpy-0.4.10-py3-none-any.whl       2017-06-07 00:25:36          444
[Information]         ecos-2.0.4-cp35-cp35m-win_amd64.whl            2017-06-07 01:03:40        56522
[Information]         __MACOSX/._ecos-2.0.4-cp35-cp35m-win_amd64.whl 2017-06-07 01:03:40          450
[Information]         numpy-1.13.0rc2+mkl-cp35-cp35m-win_amd64.whl   2017-06-07 01:25:02    127909457
[Information]         __MACOSX/._numpy-1.13.0rc2+mkl-cp35-cp35m-win_amd64.whl 2017-06-07 01:25:02          459
[Information]         scipy-0.19.0-cp35-cp35m-win_amd64.whl          2017-06-07 01:05:12     12178932
[Information]         __MACOSX/._scipy-0.19.0-cp35-cp35m-win_amd64.whl 2017-06-07 01:05:12          452
[Information]         scs-1.2.6-cp35-cp35m-win_amd64.whl             2017-06-07 01:03:34        78653
[Information]         __MACOSX/._scs-1.2.6-cp35-cp35m-win_amd64.whl  2017-06-07 01:03:34          449
[Information]         [ READING ] 0:00:00
[Information]         Input pandas.DataFrame #1:
[Information]         Empty DataFrame
[Information]         Columns: [1]
[Information]         Index: []
[Information]         [ EXECUTING ] 0:00:00
[Information]         [ WRITING ] 0:00:00

where import cvxpy, import cvxpy-0.4.10-py3-none-any.whl or cvxpy-0.4.10-py3-none-any do not work so

How can I use the following wheel files downloaded from here to use the external Python packages not found in Azure ML?

有关导入 cvxpy 的权限问题的更新(粘贴 here )

 [Error]         ImportError: No module named 'canonInterface'

where the ZIP Bundle is organised a bit differently, the content of each wheel downloaded to a folder and the content having all zipped as a ZIP Bundle.

最佳答案

根据LimitationsTechnical Notes执行Python脚本教程中,添加自定义Python模块的唯一方法是通过zip文件机制来打包模块和所有依赖项。

例如安装CVXPY,如下。

  1. 下载CVXPY的wheel文件及其依赖项如 CVXOPT .
  2. 解压这些wheel文件,并将这些文件与您的脚本一起打包在路径cvxpycvxopt等中作为压缩文件。
  3. 将 zip 文件作为数据集上传并将其用作脚本包。

如果您使用的是 IPython,您还可以尝试通过代码 !pip install cvxpy 安装 Python 包。

还有一些类似的 SO 线程可能对您有帮助,如下所示。

  1. Azure ML Python with Script Bundle cannot import module
  2. How to install a Python package from within IPython?

希望有帮助。

<小时/>

更新:

对于Azure ML的IPython接口(interface),您可以转到NOTEBOOKS选项卡,通过页面底部的ADD TO PROJECT按钮创建笔记本,如下图.

enter image description here

或者您可以直接登录网站https://notebooks.azure.com使用。

关于python - 在 Azure ML 中安装 Python 包?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44371692/

相关文章:

Python函数缓存?

python - Json.loads 抛出 ValueError

azure - 如何获取访问 token 而不是指向 Azure AD B2C 中的重定向 URL

jquery - WCF REST 服务支持来自 jQuery Mobile 的跨域调用

machine-learning - 修改损失函数更快的rcnn检测器

python - 如何从包含日期和列表中其他字符串的字符串列表中解析月份?

python - exec() 方法中自定义命名空间的子类 python 字典

sql-server - 如何获取Azure SQL Server的连接数?

azure - 如何发布 Azure 机器人

opencv - 如何从 Azure Blob 更快地加载图像?