UnicodeDecodeError: ‘utf-8’ codec can’t decode byte 0xff in position 0 when deploying to Heroku

That entire traceback is inside these parentheses: () is not available for this stack. That is the message shown when you request a Python runtime that isn’t available. In this case, it looks like your runtime.txt can’t even be read due to an unexpected encoding.

Delete it, then create a new file containing something like

python-3.10.2

only. Make sure it is UTF-8 encoded, commit, and redeploy.

At the moment, these are the currently supported Python versions, but the list changes as new versions are released:

  • python-3.10.2
  • python-3.9.10
  • python-3.8.12
  • python-3.7.12

Leave a Comment

tech