DEV Community

Harish Aravindan
Harish Aravindan

Posted on

AWS Lambda gets Python 3.11 runtime

AWS released python 3.11 runtime official blog

There are changes to the default sys.path which can be important when migrating to this new runtime

/var/task/: User Function
/opt/python/lib/pythonX.Y/site-packages/: User Layer
/opt/python/: User Layer
/var/lang/lib/pythonX.Y/site-packages/: Pre-installed modules and default pip install location
/var/runtime/: No pre-installed modules
Enter fullscreen mode Exit fullscreen mode

the /var/lang/lib/pythonX.Y/site-packages/ has been moved up the precedence so that it is searched before /var/runtime

apart from this there are a host of changes in 3.11 like tomllib file parsing and many changes
release notes https://docs.python.org/3.11/whatsnew/3.11.html

To control the minor version updates for lambda functions check the
runtime settings options under the code source --> edit runtime configuration management

runtime setting

edit runtime configuration

details of each option https://docs.aws.amazon.com/lambda/latest/dg/runtimes-update.html#runtime-management-controls

initial python 3.11 was released on Oct 2022 and current version 3.11.4 was release on June 2023. A quick sys.version check on the lambda console shows the details. 3.11.4 (main, Jul 10 2023, 22:05:45) [GCC 7.3.1 20180712 (Red Hat 7.3.1-15)]

Top comments (0)