I am trying to push a Django project to Heroku, but it keeps telling me that the following:
/app/.heroku/python/bin/pip: No such file or directory
The complete error message is shown below. How can I address this issue? Do I need to first install pip on Heroku?
Counting objects: 451, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (383/383), done.
Writing objects: 100% (451/451), 1.07 MiB | 349.00 KiB/s, done.
Total 451 (delta 87), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Python app detected
remote: -----> Installing python-3.5.1
remote: -----> Installing pip
remote: -----> Installing requirements with pip
remote: /app/tmp/buildpacks/779a8bbfbbe7e1b715476c0b23fc63a2103b3e4131eda558669aba8fb5e6e05682419376144189b29beb5dee6d7626b4d3385edb0954bffea6c67d8cf622fd51
/bin/steps/pip-install: line 5: /app/.heroku/python/bin/pip: No such file or directory
remote: ! Push rejected, failed to compile Python app.
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to rocky-tor-70537.
remote:
To https://git.heroku.com/rocky-tor-70537.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/rocky-tor-70537.git'
My requirements.txt file is empty, as shown below.
# this is for Heroku and other servers.
# Locally, you should install requirements_base.txt
-r requirements_server.txt
My requirements_server.txt is as follows:
-r requirements_base.txt
# packages that are unnecessary on Windows/Mac local dev environments, or don't install properly
psycopg2>=2.5.1
My requirements_base.txt is as follows:
appdirs==1.4.3
asgi-redis==0.14.1
asgiref==0.14.0
autobahn==0.16.0
Babel==2.3.4
boto==2.42.0
channels==0.17.3
colorama==0.3.7
contextlib2==0.5.4
coverage==4.2
daphne==0.14.3
dj-database-url==0.4.1
Django==1.8.8
django-countries==4.0
django-easymoney==0.7.1
django-floppyforms==1.7.0
django-idmap==0.4.1
django-vanilla-views==1.0.4
djangorestframework==3.4.6
honcho==0.7.1
huey==1.2.0
IPy==0.83
mock==2.0.0
msgpack-python==0.4.8
otree-core==1.2.8
otree-save-the-change==1.1.3
packaging==16.8
pbr==1.10.0
py==1.4.31
pyparsing==2.2.0
pytest==2.9.2
pytest-django==3.0.0
python-redis-lock==3.2.0
pytz==2016.6.1
raven==5.25.0
redis==2.10.5
requests==2.11.1
schema==0.6.2
six==1.10.0
Twisted==16.2.0
txaio==2.5.1
unicodecsv==0.14.1
whitenoise==3.2.1
ws4py==0.3.5
XlsxWriter==0.9.3
zope.interface==4.2.0
Looks like Heroku now supports only 3.6.1
and 2.7.13
Python versions.
https://devcenter.heroku.com/articles/python-runtimes#supported-python-runtimes
I simply had two typos in my runtime.txt
Make sure it says python-3.6.1
and not Python-3.6.1
or python 3.6.1
The error message is pretty bad. May this post save someone 30 minutes.
I ran into this issue recently and was able to adjust it by changing the python version in the runtime.txt.
Changing to
python-3.5.2
But based off your requirements that you have listed, it seems like you are never getting to the requirements_base.txt.
In your requirements_server.txt file, change it so that:
-r requirements_base.txt
is listed there.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With