Been receiving the following error when building our container.
#9 0.245 Traceback (most recent call last):
#9 0.245 File "/var/lang/bin/pip", line 3, in <module>
#9 0.245 import re
#9 0.245 File "/var/lang/lib/python3.8/re.py", line 124, in <module>
#9 0.245 import enum
#9 0.245 File "/var/lang/lib/python3.8/enum.py", line 2, in <module>
#9 0.245 from types import MappingProxyType, DynamicClassAttribute
#9 0.245 ImportError: cannot import name 'MappingProxyType' from 'types' (/var/lang/lib/python3.8/types.py)
------
executor failed running [/bin/sh -c pip install boto3]: exit code: 1
Error can be reproduced using this Dockerfile:
FROM public.ecr.aws/lambda/python:3.8
RUN mkdir -p ${LAMBDA_TASK_ROOT}/
RUN pip install boto3
The error seems to occur on any pip command in our Dockerfile, regardless of the requirements.txt or packages provided.
I noticed that the ECR image was updated today, and changing our Dockerfile to use FROM public.ecr.aws/lambda/python:3.8.2022.05.09.14 resolved the issue.
Been receiving the following error when building our container.
Error can be reproduced using this Dockerfile:
The error seems to occur on any
pip
command in our Dockerfile, regardless of therequirements.txt
or packages provided.I noticed that the ECR image was updated today, and changing our Dockerfile to use
FROM public.ecr.aws/lambda/python:3.8.2022.05.09.14
resolved the issue.