0
votes

I get this error below when i am trying to deploy my python app on heroku. Attached here are my requirements.txt file.

certifi==2018.11.29
cfe==0.0.15
chardet==3.0.4
Cython==0.29.2
dj-database-url==0.5.0
Django==2.1.2
gitdb2==2.0.5
GitPython==2.1.11
gunicorn==19.9.0
idna==2.8
libsass==0.16.1
mod-wsgi==4.6.5
numpy==1.15.4
olefile==0.46
Pillow==5.3.0
pipenv==2018.11.26
psycopg2==2.7.6.1
pystan==2.18.0.0
pytz==2018.7
requests==2.21.0
setuptools==40.5.0
six==1.12.0
smmap2==2.0.5
urllib3==1.24.1
virtualenv==16.2.0
virtualenv-clone==0.4.0
wheel==0.32.2

the error message:

remote:Running setup.py install for mod-wsgi-packages: started remote:Running setup.py install for mod-wsgi-packages: finished with status remote:adding packages/apr/build-1/mkdir.sh remote:adding packages/apr/build-1/libtool remote:adding packages/apr/build-1/make_exports.awk remote:adding packages/apr/build-1/apr_rules.mk remote: adding packages/apr/build-1/make_var_export.awk . . . . remote:/usr/bin/ld: final link failed: Bad value remote:collect2: error: ld returned 1 exit status remote:error: command 'gcc' failed with exit status 1 remote: remote: ---------------------------------------- remote:Command "/app/.heroku/python/bin/python -u -c "import setuptools, tokenize;file='/tmp/pip-build-3h0_r0m2/mod- wsgi/setup.py';f=getattr(tokenize, 'open', open) (file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install -- record /tmp/pip-z7cobg1q-record/install-record.txt --single-version- externally-managed --compile" failed with error code 1 in /tmp/pip- build-3h0_r0m2/mod-wsgi/ remote:Push rejected, failed to compile Python app. remote: remote:Push failed remote: Verifying deploy... remote: remote:Push rejected to python-tehila. remote: To https://git.heroku.com/python-tehila.git ! [remote rejected] master -> master (pre-receive hook declined) error: failed to push some refs to 'https://git.heroku.com/python- tehila.git'

1

1 Answers

0
votes

Maybe this will not help you but I feel I was struggling with a similar question when deploying on docker. For me it helped re-installing the python headers by adding the following to my docker file:

RUN apt-get install python3-dev

Besides, I feel like these are related:

Installing mod_wsgi for Python3 on Ubuntu

https://askubuntu.com/questions/569550/assertionerror-using-apache2-and-libapache2-mod-wsgi-py3-on-ubuntu-14-04-python

Finally my fatal error was:

src/server/wsgi_python.h:24:10: fatal error: Python.h: No such file or directory

And the following worked:

fatal error: Python.h: No such file or directory