python/django: deployment to heroku fails
<p>I am trying to deploy an app to heroku.
It's a python/django app, and it runs fine on my local machine.</p>

<p>When deploying, heroku downloads the packages defined in requirements.txt, but then stops complaining about <code>qpython</code> not being able to be built, because it can't find <code>numpy</code>. But from the log output it's visible that <code>numpy</code> is being downloaded, and installed BEFORE qpython.</p>

<p>The only thing I could think of is that the logs actually say 
"Collecting" and "Downloading", but not explicitly "Installing"...Could it be that the way heroku handles this causes qpython to be built before numpy is being installed? It's a weird assumption but the only one I could think of. In any case, I don't and would not know what to do.</p>

<p>I defined python to be python 2.7.12 in runtime.txt.</p>

<pre><code>$ git push heroku-dev django6_12:master
Counting objects: 21, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (20/20), done.
Writing objects: 100% (21/21), 1.99 KiB | 0 bytes/s, done.
Total 21 (delta 16), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
/*...more output omitted for brevity */
remote: -----&gt; Python app detected
remote: -----&gt; Installing python-2.7.12
remote: -----&gt; Noticed cffi. Bootstrapping libffi.
remote:      $ pip install -r requirements.txt
/*...more output omitted for brevity */
remote:        Collecting nodeenv==0.7.2 (from -r requirements.txt (line 36))
remote:          Downloading nodeenv-0.7.2.tar.gz
remote:        Collecting numpy==1.8.1 (from -r requirements.txt (line 37))
remote:          Downloading numpy-1.8.1-cp27-cp27m-manylinux1_x86_64.whl (14.6MB)
remote:        Collecting pandas==0.14.0 (from -r requirements.txt (line 38))
remote:          Downloading pandas-0.14.0.zip (7.3MB)
/*...more output omitted for brevity 
**Note how numpy is being installed** */
remote:        Collecting qpython==1.0.0 (from -r requirements.txt (line 112))
remote:          Downloading qPython-1.0.0.zip (75kB)
remote:            Complete output from command python setup.py egg_info:
remote:            Traceback (most recent call last):
remote:              File "&lt;string&gt;", line 1, in &lt;module&gt;
remote:              File "/tmp/pip-build-NoEaTG/qpython/setup.py", line 19, in &lt;module&gt;
remote:                import numpy
remote:            ImportError: No module named numpy
remote:            
remote:            ----------------------------------------
remote:        Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-NoEaTG/qpython/
remote:  !     Push rejected, failed to compile Python app.



$ git push heroku-dev django6_12:master
Counting objects: 21, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (20/20), done.
Writing objects: 100% (21/21), 1.99 KiB | 0 bytes/s, done.
Total 21 (delta 16), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
/*...more output omitted for brevity */
remote: -----&gt; Python app detected
remote: -----&gt; Installing python-2.7.12
remote: -----&gt; Noticed cffi. Bootstrapping libffi.
remote:      $ pip install -r requirements.txt
/*...more output omitted for brevity */
remote:        Collecting nodeenv==0.7.2 (from -r requirements.txt (line 36))
remote:          Downloading nodeenv-0.7.2.tar.gz
remote:        Collecting numpy==1.8.1 (from -r requirements.txt (line 37))
remote:          Downloading numpy-1.8.1-cp27-cp27m-manylinux1_x86_64.whl (14.6MB)
remote:        Collecting pandas==0.14.0 (from -r requirements.txt (line 38))
remote:          Downloading pandas-0.14.0.zip (7.3MB)
/*...more output omitted for brevity 
**Note how numpy is being installed** */
remote:        Collecting qpython==1.0.0 (from -r requirements.txt (line 112))
remote:          Downloading qPython-1.0.0.zip (75kB)
remote:            Complete output from command python setup.py egg_info:
remote:            Traceback (most recent call last):
remote:              File "&lt;string&gt;", line 1, in &lt;module&gt;
remote:              File "/tmp/pip-build-NoEaTG/qpython/setup.py", line 19, in &lt;module&gt;
remote:                import numpy
remote:            ImportError: No module named numpy
remote:            
remote:            ----------------------------------------
remote:        Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-NoEaTG/qpython/
remote:  !     Push rejected, failed to compile Python app.
</code></pre>

<p>Like it says, you need to have numpy installed (it doesn't install on heroku with pip).</p>

<p>You have to use a buildpack to install numpy on your heroku app:</p>

<p><a href="https://github.com/thenovices/heroku-buildpack-scipy" rel="nofollow">https://github.com/thenovices/heroku-buildpack-scipy</a></p>

python django numpy heroku qpython