Heroku Python Support Reference
Last updated December 12, 2024
Table of Contents
Heroku supports Python applications, including ones built with popular frameworks like Django, FastAPI, and Flask. This document contains version support info.
To learn more about how Heroku recognizes and builds Python applications, see Python Behavior in Heroku.
To learn how to deploy a sample Python app, check out the Getting Started on Heroku with Python tutorial.
Default Python Version for New Apps
By default, newly created Python apps use the latest patch version of Python 3.13.
For Cedar-generation apps, subsequent builds of the app get pinned to that initial major Python version unless you specify a different version or clear the build cache.
For Fir-generation apps, subsequent builds of the app use the default Python version at the time of the build, and so the version used can change over time.
We strongly recommend that you specify a Python version for your app in
a .python-version
file instead of relying on the default version.
Specify a Python Version
Specify a Python version by using a .python-version
file added to the root of your app, like in this example.
Supported Python Versions
A supported version means that you can expect our tools and platform to work with a given version. It also means you can receive technical support.
- Python 3.13
- Python 3.12
- Python 3.11
- Python 3.10
Deprecated Python Versions
The following is a list of deprecated runtime versions present for each stack. We deprecate versions as they approach end-of-life (EOL), and remove support shortly after EOL occurs. For more information, see our Language Support Policy.
- Python 3.9
- Python 3.8: available on the Heroku-20 stack only; supported until January 7, 2024
We no longer support Python versions older than the ones listed. We stop supporting Python versions when they reach their upstream EOL.
Python Version Support Policy
Our Python version support follows the upstream Python Version Lifecycle. We recommend running the latest patch release of a supported Python version. We recommend upgrading before a Python version reaches its upstream end-of-life.
Behavior
See Python Behavior in Heroku to learn more about how Heroku handles Python applications.
Customer Support
You can submit issues via one of the Heroku Support channels.