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

前端 未结 4 1954
情书的邮戳
情书的邮戳 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:36

    I had difficulty using matplotlib with heroku as well and the answers are very hard to find. This helped me.

    Basically what you have to do is push the project with numpy in the requirements.txt. Only after this we have to add pandas and matplotlib to the requirements.txt.

    0 讨论(0)
  • 2020-12-18 09:37

    I had the same problem then I noticed in the building app in heroku that by installing matplotlib, it wants to re-install numpy and there it crashes on that point. I removed numpy from the requirements file and it went smoothly.

    0 讨论(0)
  • 2020-12-18 09:47

    For those currently looking this answer up, I just deployed on the lastest heroku with the latest matplotlib/numpy as a requirement (1.4.3, 1.9.2 respectively) without any issues.

    0 讨论(0)
  • 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

    0 讨论(0)
提交回复
热议问题