使用numpy的&安培; SciPy的天青Web角色 [英] Use numpy & scipy in Azure web role

查看:249
本文介绍了使用numpy的&安培; SciPy的天青Web角色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的Azure网站与瓶Python项目考虑。我已经有这个配置运行测试网站。我使用cPhyton 2.7; (但)支持在Azure中IronPhyton绝对是丢弃这个项目,据我所知,其实不然。

I'm considering using an Azure web site for a Python project with Flask. I already have a test site running with this configuration. I'm using cPhyton 2.7; IronPhyton is absolutely discarded for this project and, as far as I know, it is not (yet) supported in Azure.

坏的部分是,我需要添加 SciPy的&安培; numpy的这个项目,这是一个不可回避的要求。据我所知,numpy的和SciPy的是编译非托管code和蟒蛇code的组合,他们是不是一部分的标准的Azure基础设施开发。

The bad part is that I need to add scipy & numpy to this project, this is an unavoidable requirement. As far as I know, numpy and scipy are a mix of compiled unmanaged code and python code and they're not part of the standard Azure infrastructure.

是否有可能numpy的/ SciPy的包添加到Azure的网站?如果是,怎么了?

Is it possible to add numpy/scipy packages to an Azure web site? If it is, how?

注:我知道我可以使用这个虚拟机(天青与否),这是我的第二选择,但我想做出明智的决定。

Note: I know I could use a virtual machine for this (azure or not), that's my second option, but I would like to make an informed decision.

感谢您

推荐答案

我能够numpy的添加到我的Azure Web App网站。我相信我的方法也适用于SciPy的。

I was able to add Numpy to my Azure Web App site. I believe my method also works for SciPy.

我假设你有一个本地仓库(我用GIT),并将其上传到您的Azure网站。我使用Django和有一个叫requirements.txt在基本文件,我敢打赌,是有瓶也。这个文件的每一行包含您要添加到安装包。

I am assuming you have a local repository (I am using GIT) and upload it to your Azure site. I am using Django and there is a file called requirements.txt in the base, which I bet is there for Flask also. Each line of this file contains a package that you want added to the installation.

起初我只是增加了一个符合numpy的它和Azure中发现了一个包,并试图安装但失败了。所以,我的下一次尝试我下载了一个轮子.whl包从该网站:

At first I simply added a line with "Numpy" to it and Azure found a package and tried to install but this failed. So my next attempt I downloaded a "wheel" .whl package from this site:

http://www.lfd.uci.edu/~gohlke/pythonlibs/

,其中包括所有的依赖。下载numpy的和SciPy的车轮文件的相应的文件(Python中的正确版本和32或可以Azure的控制面板上选择64位),并坚持到你的根目录,并将其添加到您的项目。现在,一行只有文件名requirements.txt,像这样的:

which includes all dependencies. Download the appropriate file (correct version of Python and 32 or 64 bit which can be chosen on Azure control panel) of the Numpy and SciPy wheel files and stick them into your base directory and add them to your project. Now a line to requirements.txt with just the file name, like this:

numpy的-1.9.2 + MKL-cp27-NONE-win32.whl

numpy-1.9.2+mkl-cp27-none-win32.whl

Commit和推到Azure和瞧!一切都正确安装。这也为我工作了OpenCV的轮包在该网站。祝你好运!

Commit and push to Azure and Voila! everything installs correctly. This also worked for me for the OpenCV wheel package at that site. Good luck!

这篇关于使用numpy的&安培; SciPy的天青Web角色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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