3

I'm trying to deploy a web app on Heroku that uses matplotlib. This question is related but doesn't seem to address my specific problem. More precisely, I'm deploying a duplicate app "staging" for testing purposes. When I run the command:

git push staging master

to push my app to Heroku I get an unexpected Heroku push rejection:

           ============================================================================
           BUILDING MATPLOTLIB
                       matplotlib: 1.1.1
                           python: 2.7.2 (default, Oct 31 2011, 16:22:04)  [GCC 4.4.3]
                         platform: linux2

           REQUIRED DEPENDENCIES
                            numpy: no
                                   * You must install numpy 1.4 or later to build
                                   * matplotlib.
           Complete output from command python setup.py egg_info:
           basedirlist is: ['/usr/local', '/usr']

       ============================================================================

       BUILDING MATPLOTLIB

                   matplotlib: 1.1.1

                       python: 2.7.2 (default, Oct 31 2011, 16:22:04)  [GCC 4.4.3]

                     platform: linux2



       REQUIRED DEPENDENCIES

                        numpy: no

                               * You must install numpy 1.4 or later to build

                               * matplotlib.

       ----------------------------------------
       Command python setup.py egg_info failed with error code 1 in /tmp/build_sj82km4g47z3/.heroku/venv/build/matplotlib
       Storing complete log in /app/.pip/pip.log
 !     Heroku push rejected, failed to compile Python app

To git@heroku.com:warm-atoll-3630.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git@heroku.com:warm-atoll-3630.git'

Unexpected because I thought I had resolved this problem. Indeed my production app is working just fine. I resolved it by having a two layered requirements file.

requirements.txt:

numpy==1.6.2
-r ./prod-requirements.txt

prod-requirements.txt:

matplotlib==1.1.1
other requirements... 

Clearly I have forgotten how I actually resolved this issue. I remember that because of the way matplotlib depends on numpy and how Heroku installs requirements via pip that this is tricky. Here is the issue I'm referring to. What can be done? Thanks in advance.

Community
  • 1
  • 1
Drew Verlee
  • 1,880
  • 5
  • 21
  • 30

1 Answers1

3

I resolved the issue by removing matplotlib from my prod-requirements.txt file (see orginal question). Then deploying, then adding matplotlib to my prod-requirements.txt file then deploying again. I had assumed that's what was achieving by having a requirements.txt:

numpy==1.6.2
-r ./prod-requirements.txt

And then putting matplotlib=1.1.1 in the prod-requirements file . But apparently not. It seems likely that i could have achieved this with just one requirements file.

Drew Verlee
  • 1,880
  • 5
  • 21
  • 30