I am trying to deploy an app to heroku. It's a python/django app, and it runs fine on my local machine.
When deploying, heroku downloads the packages defined in requirements.txt, but then stops complaining about qpython
not being able to be built, because it can't find numpy
. But from the log output it's visible that numpy
is being downloaded, and installed BEFORE qpython.
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.
I defined python to be python 2.7.12 in runtime.txt.
$ 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: -----> Python app detected
remote: -----> Installing python-2.7.12
remote: -----> 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 "<string>", line 1, in <module>
remote: File "/tmp/pip-build-NoEaTG/qpython/setup.py", line 19, in <module>
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: -----> Python app detected
remote: -----> Installing python-2.7.12
remote: -----> 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 "<string>", line 1, in <module>
remote: File "/tmp/pip-build-NoEaTG/qpython/setup.py", line 19, in <module>
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.
Like it says, you need to have numpy installed (it doesn't install on heroku with pip).
You have to use a buildpack to install numpy on your heroku app: