问题描述
众所周知,我认为Heroku(仍然是这样)是一个可以使用python 3.5,scipy和flask的创建烧瓶web应用程序。无法在其平台上安装scipy。我想知道是否有人知道如何将Flask应用推送到可以使用scipy的Heroku。我知道有存在的构建包(像这个 https://github.com/kennethreitz/conda-buildpack
),但他们不使用python的版本,我会像和似乎没有让gunicorn和烧瓶做网页应用程序的东西。
我不知道这是否足够清楚,所以评论如果有反正我可以更加清楚。
我必须制作一个新的buildpack自从我之前改变了,现在只支持 Python 2.7 ,我将继续维护它。 Mine支持 Python 3 。这是你应该做的一步一步。 > 1)添加此
I'm try to use create a flask web app on Heroku that uses python 3.5, scipy and flask.
It's well known I suppose that Heroku (still) can't install scipy on its platform. I'm wondering if anyone knows how to push a Flask app to Heroku that can use scipy. I know there are buildpacks that exist (like this one https://github.com/kennethreitz/conda-buildpack
) but they don't use the version of python I would like and doesn't seem to let gunicorn and flask do there web app thing.
I don't know if that's clear enough so comment if there's anyway I can make it more clear.
EDIT I had to make a new buildpack that I will maintain since the one that I had previously was changed and now only supports Python 2.7. Mine supports Python 3.
Here's step by step what you should do.
1) Add this https://github.com/arose13/conda-buildpack.git to your BUILDPACK_URL
2) Create a conda-requirements.txt
with all your requirements that you need anaconda to get, here is where you include python version 3 and scipy. This can be done in command-line with...
conda list -e > conda-requirements
3) Order matters in the conda-requirements.txt
. It should look like this...
numpy=1.10.1
scipy=0.16.0
4) requirements.txt
contains all the requirements that you want pip
to install. You can use pip freeze > requirements.txt
Just make sure that there's nothing on this list that is on the conda-requirements.txt
list.
5) Push to Heroku.
PS: github project example is here https://github.com/arose13/HerokuCondaScipyFlaskApp
这篇关于在Heroku上使用Python 3.5和Scipy部署Flask App的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!