Deploy matplotlib on heroku failed. How to do this correctly?

前端 未结 4 1968
情书的邮戳
情书的邮戳 2020-12-18 09:12

I\'ve install matplotlib in my virtualenv using pip. It was a failure at the beginning, but after I do easy_install -U distribute, the installation goes smoothl

4条回答
  •  爱一瞬间的悲伤
    2020-12-18 09:51

    Finally I'm able to manage this.

    First of all, I use this buildpack: https://github.com/dbrgn/heroku-buildpack-python-sklearn To use this buildpack I run this (maybe it is not a necessary step):

    heroku config:set BUILDPACK_URL=https://github.com/dbrgn/heroku-buildpack-python-sklearn/
    

    Then I change the requirements.txt into this:

    argparse==1.2.1
    distribute==0.6.24
    gunicorn==17.5
    wsgiref==0.1.2
    numpy==1.7.0
    matplotlib==1.1.0
    scipy==0.11.0
    scikit-learn==0.13.1
    

    The most important part here is I install matplotlib 1.1.0 (currently the newest is 1.3.0). Some "deprecated numpy API" warnings might be occurred. But in my case it seems to be alright.

    And here is the result (the page site might probably down since I use the free server one) http://kokoropy.herokuapp.com/example/plotting

    A matplotlib generated figure

提交回复
热议问题