After creating a repository in Heroku, I want to push my project from master branch to my heroku repo.
On my first try I got the following error message:
No default language could be detected for this app
After searching, I used the following command:
heroku buildpacks:set heroku/python
Now it gave me this error message:
App not compatible with buildpack: https://buildpack-registry.s3.amazonaws.com/buildpacks/heroku/python.tgz
So now I tried everything from the beginning and it gives me the following error:
Python app detected
Requested runtime ("python-3.7.1") is not available for this stack (heroku-18).
I am stuck here.
I do have a requirements.txt
with all the requirements and a runtime.txt
in the same folder as my manage.py
file.
Your python version is not supported on heroku stack 20 - and make sure your python version in runtime is in lower case - see below Share Improve this answer Follow edited Apr 27 at 19:42
Heroku supports all popular web frameworks for Python (Django, Flask, Pyramid, and so on). For a deployment tutorial that uses a sample Django app, see Getting Started on Heroku with Python. Recognizing a Python app Heroku automatically recognizes your app as a Python app if it includes a requirements.txt or setup.py file in its root directory.
If you are seeing “Requested runtime is not available for this stack” errors using one of the versions above, check that your app is using the latest version of the Python buildpack. Python 2 has reached its community-specified end of life and any apps still using it should be migrated to Python 3 as soon as possible.
For Django applications, a Heroku Postgres hobby-dev database is automatically provisioned. This populates your app’s DATABASE_URL config var. A Heroku Postgres database is not automatically provisioned for other Python apps, but you can easily provision one manually.
Check your current version of Python:
C:\Python --version
Suppose:
Python 3.8.5
Now goto runtime.txt
& specify your version of Python:
Syntax: python-<version>
Example:
python-3.8.5
is CORRECT.
Python-3.8.5
is INCORRECT.
Python 3.8.5
is INCORRECT.
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