I am trying to push an django web app to heroku for the first time, and there are some error message as following.
Delta compression using up to 4 threads.
Compressing objects: 100% (68/68), done.
Writing objects: 100% (81/81), 105.31 KiB | 0 bytes/s, done.
Total 81 (delta 7), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Python app detected
remote: -----> Installing Python-3.5.0
remote: ! Requested runtime (Python-3.5.0) is not available for this stack
(cedar-14).
remote: ! Aborting. More info: https://devcenter.heroku.com/articles/pytho
n-support
remote:
remote: ! Push rejected, failed to compile Python app
remote:
remote: Verifying deploy...
remote:
remote: ! Push rejected to polar-lake-12528.
remote:
To https://git.heroku.com/polar-lake-12528.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/polar-lake-12528.git'
My runtime.txt looks like:
python-3.5.1
I have already changed to lowercase and update the version of python to 3.5.1, but still not working.
Python 3.5.0 is not supported. You can change it to python-3.5.1.
See https://devcenter.heroku.com/articles/python-runtimes#supported-python-runtimes for supported runtimes.
Related
added requirement.txt, Procfile,
receving error while deploying site to heroku
what could be wrong with this
Enumerating objects: 110, done.
Counting objects: 100% (110/110), done.
Delta compression using up to 8 threads
Compressing objects: 100% (106/106), done.
Writing objects: 100% (110/110), 13.54 MiB | 1.30 MiB/s, done.
Total 110 (delta 35), reused 0 (delta 0), pack-reused 0
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Building on the Heroku-20 stack
remote: -----> Using buildpack: heroku/python
remote: -----> *App not compatible with buildpack: https://buildpack-
registry.s3.amazonaws.com/buildpacks/heroku/python.tgz*
remote: More info: https://devcenter.heroku.com/articles/buildpacks#detection-failure
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to covidcms.
remote:
To https://git.heroku.com/covidcms.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/covidcms.git'
You have to rename your requirement.txt file to requirements.txt
Heroku automatically recognizes your app as a Python app if it includes a requirements.txt or setup.py file in its root directory.
When a deployed application is recognized as a Python application, you’ll see this in the build output:
$ git push heroku master
-----> Python app detected
for more information check official doc. https://devcenter.heroku.com/articles/python-support#recognizing-a-python-app
I am trying to use $ git push heroku master but I get this error:
$ git push heroku master
Counting objects: 6, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (6/6), 534 bytes | 534.00 KiB/s, done.
Total 6 (delta 0), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Python app detected
remote: ! The latest version of Python 3 is python-3.6.5 (you are using , which is unsupported).
remote: ! We recommend upgrading by specifying the latest version (python-3.6.5).
remote: Learn More: https://devcenter.heroku.com/articles/python-runtimes
remote: -----> Installing
remote: ! Requested runtime () is not available for this stack (heroku-16).
remote: ! Aborting. More info: https://devcenter.heroku.com/articles/python-support
remote: ! Push rejected, failed to compile Python app.
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to securibot.
remote:
To https://git.heroku.com/securibot.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/securibot.git'
My runtime.txt file reads the following:
python-3.6.5
Any idea why I'm getting this error?
Did you read the referenced URL that was posted?
If you look through https://devcenter.heroku.com/articles/python-runtimes, you will see that "Newly created Python applications default to the Python 3.6.4 runtime".
You can specify your own run time in either your Pipfile or creating a runtime.txt with the following:
python-3.6.5
I have an issue publishing my python code to heroku
keep in mind that this is my first project on heroku and first with anything to do with repositories
Counting objects: 18, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (16/16), done.
Writing objects: 100% (18/18), 21.80 KiB | 0 bytes/s, done.
Total 18 (delta 2), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Python app detected
remote: ! The latest version of Python 3 is python-3.6.5 (you are using python-3.6, which is unsupported).
remote: ! We recommend upgrading by specifying the latest version (python-3.6.5).
remote: Learn More: https://devcenter.heroku.com/articles/python-runtimes
remote: -----> Installing python-3.6
remote: ! Requested runtime (python-3.6) is not available for this stack (heroku-16).
remote: ! Aborting. More info: https://devcenter.heroku.com/articles/python-support
remote: ! Push rejected, failed to compile Python app.
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to project.
remote:
To https://git.heroku.com/project.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/project.git'
Try this
pipenv lock
git add.
git commit -am "make it better"
git push heroku master
If you want a different version, edit the new file and enter the information in:
[requires]
python_version = "2.7" or [requires] python_full_version = "2.7.15"
your requirements.txt file must contain python-3.6.5 everything in small letters and - sign is important
I updated the python version from 3.6.4 to 3.6.5 today. This is because, in the process of distributing to Heroku, it recommends version 3.6.5. Therefore, the following power shell contents were confirmed.
Writing objects: 100% (35/35), 11.68 KiB | 0 bytes/s, done.
Total 35 (delta 3), reused 0 (delta 0)
remote: Compressing source files... done.
remote: -----> Python app detected
remote: ! The latest version of Python 3 is python-3.6.5 (you are using ÿþpython-3.6.5, which is unsupported).
remote: ! We recommend upgrading by specifying the latest version (python-3.6.5).
remote: Learn More: https://devcenter.heroku.com/articles/python-runtimes
remote: -----> Installing ÿþpython-3.6.5
remote: ! Requested runtime (ÿþpython-3.6.5) is not available for this stack (heroku-16).
remote: ! Aborting. More info: https://devcenter.heroku.com/articles/python-support
remote: ! Push rejected, failed to compile Python app.
remote:
remote: ! Push failed
remote:
remote: ! Push rejected to XXXXXXXX.
remote:
To https://git.heroku.com/XXXXXXXX.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/XXXXXXXX.git
After changing my runtime.txt file to UTF-8, I now get the following error:
Writing objects: 100% (35/35), 11.68 KiB | 0 bytes/s, done.
Total 35 (delta 3), reused 0 (delta 0)
remote: Compressing source files... done.
remote: -----> Python app detected
remote: ! The latest version of Python 3 is python-3.6.5 (you are using python-3.6.5, which is unsupported).
remote: ! We recommend upgrading by specifying the latest version (python-3.6.5).
remote: Learn More: https://devcenter.heroku.com/articles/python-runtimes
remote: -----> Installing python-3.6.5
remote: ! Requested runtime (python-3.6.5) is not available for this stack (heroku-16).
remote: ! Aborting. More info: https://devcenter.heroku.com/articles/python-support
remote: ! Push rejected, failed to compile Python app.
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to XXXXXXXX.
remote:
To https://git.heroku.com/XXXXXXXX.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/XXXXXXXX.git
Why is python-3.6.5 being rejected? Isn't that exactly what Heroku says is the default version?
Heroku believes that your runtime.txt contains some extra characters:
ÿþpython-3.6.5
This is probably byte-order mark for a file encoded as UTF-16 in little-endian order. Make sure you're using a sane encoding for that file (and others). UTF-8 is a good choice in virtually all situations.
You're trying to install ÿþpython-3.6.5 not python-3.6.5 as the console output suggests. Remove ÿþ and it should work as expected.
I can't seem to figure out why my Heroku push keeps failing after hours and hours of research. The app works just fine in my terminal.
Counting objects: 12, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (10/10), done.
Writing objects: 100% (12/12), 5.80 KiB | 5.80 MiB/s, done.
Total 12 (delta 2), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> App not compatible with buildpack: https://codon-buildpacks.s3.amazonaws.com/buildpacks/heroku/python.tgz
remote: More info: https://devcenter.heroku.com/articles/buildpacks#detection-failure
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to agile-brook-99462.
remote:
To https://git.heroku.com/agile-brook-99462.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/agile-brook-99462.git'
Things I have done:
Set buildpack to heroku/python
Set Python version to 2.7 with runtime.txt
Added requirements.txt
Added Procfile
Tried git push -f heroku master
Created a new app and re-tried all steps again
None of the above steps have remedied the situation. Any tips?