The following table provides an overview of the Python versions supported by AWS SDK for Python:
|Python 3.9||Amazon Linux 2|
|Python 3.8||Amazon Linux 2|
|Python 3.7||Amazon Linux|
|Python 3.6||Amazon Linux|
|Python 2.7||Amazon Linux|
Boto3 is the Software Development Kit (SDK) for Python from Amazon Web Services (AWS). It provides you with a convenient API in Python to access Amazon services such as S3 and EC2.
? Important: Python 2.7 is depreciated as of 01/15/2021 and there is no support for it anymore since 07/15/2021. Please upgrade your installation accordingly. You can find the support and end-of-life announcements of Python versions here.
Will Python 2.7 AWS Lambda Functions Still Run?
Yes. The official AWS blog announced that Python 2.7 functions will still be allowed to run. This also holds for functions deployed as container images. But of course, they recommend upgrading for security and efficiency reasons.
How to Migrate From Python 2.7 to 3?
You can list all Python 2.7 functions in a specific region with this command in the AWS command-line interface:
aws lambda list-functions --function-version ALL --output text --query "Functions[?Runtime=='python2.7'].FunctionArn"
To upgrade from Python 2 to Python 3, consider the following guides:
- Porting Python 2 code to Python 3
- Automated Python 2 to 3 code translation
- Migrating from Python 2 to 3
I’d personally recommend the third of those tutorials.
While working as a researcher in distributed systems, Dr. Christian Mayer found his love for teaching computer science students.
To help students reach higher levels of Python success, he founded the programming education website Finxter.com that has taught exponential skills to millions of coders worldwide. He’s the author of the best-selling programming books Python One-Liners (NoStarch 2020), The Art of Clean Code (NoStarch 2022), and The Book of Dash (NoStarch 2022). Chris also coauthored the Coffee Break Python series of self-published books. He’s a computer science enthusiast, freelancer, and owner of one of the top 10 largest Python blogs worldwide.
His passions are writing, reading, and coding. But his greatest passion is to serve aspiring coders through Finxter and help them to boost their skills. You can join his free email academy here.