Home > Enterprise >  Heroku cant find python version i specified on runtime.txt
Heroku cant find python version i specified on runtime.txt

Time:10-26

i tried to deploy a python app to heroku, i already have runtime.txt on root of my directory but idk why heroku cant find the "runtime.txt" file i specified and always giving this message:

Building on the Heroku-22 stack
-----> Determining which buildpack to use for this app
-----> Python app detected
-----> No Python version was specified. Using the buildpack default: python-3.10.8
       To use a different version, see: https://devcenter.heroku.com/articles/python-runtimes
-----> Installing python-3.10.8

enter image description here

enter image description here

i tried to find answer on stackoverflow and find similiar questions with no approved answers and also i tried to matching my python version with python runtime that supported by heroku.

CodePudding user response:

First, make sure you commit the runtime.txt file to git, otherwise, Heroku won't see it.

Also, Please see the supported versions for each stack. Your message says that you're using Stack 22, but Python 3.7.15 is only supported by Stack 18 and Stack 20. This can easily be solved by changing your stack with heroku stack:set heroku-20.

  • Related