类似于here的问题,但现在是关于Python包的。目前,CVXPY在Azure ML中缺失。我也在尝试让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)]
用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
orcvxpy-0.4.10-py3-none-any
do not work soHow 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.
我将演示彼得潘的答案here,首先展示一个使用外部包的工作实验。为外部包CVXPY构建ZIP包并不是那么直接,而是很有教育意义。
有关在Azure ML中使用ZIP包的外部包的演示
这是一个关于在Smit Shah提供的Python脚本模块中使用附加包的工作示例
其中
因此,ZIP包是以一种特定的方式完成的,这样包的dist info文件夹就会被删除,并且只包括具有包的确切名称的文件夹
通过它,我可以运行
import cvxpy
,注意包含了新的包multiplocess
和CVXCanon
。然而,在解决一个问题时,我发现接下来缺少ecos
模块时出错。因此,我为原始ecos.*.wheel
包中找到的所有文件创建了一个新目录ecos
,因此更新后的ZIP包如下所示通过这个方法,我可以用一个叫做CVXPY的DCP工具来解决下面的凸优化问题。
Python脚本模块中的代码,它解决了Azure ML中CVXPY的优化问题
进一步阅读
或者用这样的东西
Installing python module within code
根据} 和^{} ,添加自定义Python模块的唯一方法是通过zip文件机制打包模块和所有依赖项。
Execute Python Script
教程中的^{例如安装
CVXPY
,如下所示。cvxpy
和cvxopt
等中,作为带有脚本的压缩文件。如果您使用的是IPython,也可以尝试通过代码
!pip install cvxpy
安装Python包。还有一些类似的SO线程可能对您有帮助,如下所示。
希望有帮助。
更新:
对于Azure ML的IPython接口,您可以移动到页面底部的
NOTEBOOKS
选项卡,通过ADD TO PROJECT
按钮创建一个笔记本,如下图所示。也可以直接登录网站
https://notebooks.azure.com
使用。相关问题 更多 >
编程相关推荐