Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error while pushing to Heroku: requested runtime is not available for this stack

Tags:

python

heroku

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.

like image 849
haneulkim Avatar asked Feb 23 '19 02:02

haneulkim


People also ask

Why my Python version is not supported on Heroku stack 20?

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

What web frameworks does Heroku support?

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.

Why is runtime not available for this stack?

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.

How do I provision a Heroku Postgres database in Django?

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.


1 Answers

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.

like image 70
Zahid Khan Avatar answered Sep 26 '22 04:09

Zahid Khan