Which Python versions should my library support?
For which version should I develop my web service / application?
For the second question, I like to never take a x.y.0 version. Let them get the patches out first.
Lifecycle of cPython
I've asked which CPython versions get support right now on SO, and it got heavily downvoted. But I got the answer:
Python Version | PEP | First Release | End-of-life |
---|---|---|---|
3.8 | PEP 569 | 2019-10-14 | 2024-10 |
3.7 | PEP 537 | 2018-06-27 | 2023-06-27 |
3.6 | PEP 494 | 2016-12-23 | 2021-12-23 |
3.5 | PEP 478 | 2015-09-13 | 2020-09-13 |
Python Interpreters
CPython is by far the most commonly used interpreter, but there are others. PyPy for example. And currently only supports Python 3.6, although development of Python 3.9 has already started (see pypy.org for the latest state).
So if you want to allow the usage of other interpreters, you might need to use older Python versions.
AWS Lambda
Documentation states:
Python Version | boto3 | botocore | Operating System |
---|---|---|---|
Python 3.8 | boto3-1.10.34 | botocore-1.13.34 | Amazon Linux 2 |
Python 3.8 | boto3-1.10.34 | botocore-1.13.34 | Amazon Linux |
Python 3.8 | boto3-1.10.34 | botocore-1.13.34 | Amazon Linux |
Python 2.7 | boto3-1.10.34 | botocore-1.13.34 | Amazon Linux |
Distribution Defaults
Linux distributions ship with Python. The default of those influences a lot what is used. I've used the debian package search and the Ubuntu package search to get the numbers:
Operating System | Package "python" | Package "python3" |
---|---|---|
Ubuntu 18.04 LTS | 2.7.x | 3.6.x |
Ubuntu 19.04 | 2.7.x | 3.7.x |
Ubuntu 19.10 | 2.7.x | 3.7.x |
Debian (jessie) | 2.7.x | 3.4.x |
Debian (stretch) | 2.7.x | 3.5.x |
Debian (buster) | 2.7.x | 3.7.x |
Debian (bullseye) | 2.7.x | 3.7.x |
Debian (sid) | 2.7.x | 3.7.x |
Python Download Statistics
I'm trying to get more recent data, but here you see subtotals for some time before May 2019:
Python Version | Sum of Hits | % of Hits |
---|---|---|
3.7.x | 15,519,728 | 58.36% |
3.6.x | 5,616,969 | 21.12% |
2.7.x | 4,112,428 | 15.46% |
3.5.x | 1,187,840 | 4.47% |
3.8.x | 156,111 | 0.59% |
Grand Total | 26,593,076 | 100% |
pipenv download statistics
I'm still trying to get those.
Google Trends
See also
- Jetbrains: Python, 2019.
- w3techs.com: Usage statistics of Python Version 3 for websites
- Stackoverflow: python runtime version statistics, 2016.