Skip to content Skip to sidebar Skip to footer

Deploying Flask App Using Python 3.5 And Scipy On Heroku

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 wonder

Solution 1:

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.1scipy=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

Post a Comment for "Deploying Flask App Using Python 3.5 And Scipy On Heroku"