Maintained with ☕️ by
IcePanel logo

AWS Lambda adds support for Python 3.9

Share

Services

AWS Lambda now supports Python 3.9 as both a managed runtime and a container base image. You can now author AWS Lambda functions in Python 3.9 and use its new features, such as support for TLS 1.3, new string and dictionary operations, and improved time zone support. Python 3.9 also includes performance optimizations that you can benefit from without making any code changes. For more information on Lambda’s support for Python 3.9, see our blog post at [Python 3.9 runtime now available in AWS Lambda](https://aws.amazon.com/blogs/compute/python-3-9-runtime-now-available-in-aws-lambda). To deploy Lambda functions using Python 3.9, upload the code through the Lambda console and select the Python 3.9 runtime. You can also use the AWS CLI, [AWS Serverless Application Model (AWS SAM)](https://github.com/awslabs/serverless-application-model) and [AWS CloudFormation](/cloudformation/) to deploy and manage serverless applications written in Python 3.9\. Additionally, you can also use the [AWS-provided Python 3.9 base image](https://docs.aws.amazon.com/lambda/latest/dg/python-image.html) to build and deploy Python 3.9 functions using a container image. To migrate existing Lambda functions running earlier Python versions, [update your code to be compatible with Python 3.9](https://docs.python.org/3/whatsnew/3.9.html#porting-to-python-3-9) and then update the function runtime to Python 3.9. Python 3.9 is the latest release of Python and will be supported for security and bug fixes until October 2025\. Lambda will automatically apply updates to the Python 3.9 managed runtime and to the Python 3.9 AWS-provided base image, as they become available from the Python community. The Python 3.9 runtime is available in all [Regions where Lambda is available](/about-aws/global-infrastructure/regional-product-services/), except for China Regions. Visit our [product page](/lambda/) for more information about AWS Lambda or sign in to the [AWS Lambda console](https://console.aws.amazon.com/lambda/home) to get started.