The other day I found that:
- Heroku needs Python 3.6 or later to work (as of June 22, 2018). See: Getting Started on Heroku with Python.
- Debian Stretch (Debian Stable as of June 22, 2018) and its backports have only Python 3.5.
The solution was to build a Docker image based upon Ubuntu 18.04, which does have Python 3.6. See the project https://gitlab.com/TDDPirate/heroku_on_debian in GitLab.
July 15, 2018 update:
After I complained about flakiness of Selenium-based tests when the Selenium server is running outside of the Docker container while the application runs inside the container, Udi Oron suggested another way to run Python 3.6 on a Debian Stretch system: use pyenv.
Turns out that pyenv solves the pain point of running Python 3.6 on Debian Stretch without having to use a container. So Selenium-based tests are now stable.
The following is an excellent article about using pyenv:
Pyenv – Python Version Management Made Easier
And the following is a link to the GitHub repository:
I suspect that pyenv is the reason why people are not in a hurry to backport new Python versions to Debian.