Lambda docker base - unable to install matplotlib
It seems like you're getting an error because of missing binaries that are needed to compile matplotlib.
Can you try to install the additional g++
package? It is usualy named gcc-c++
with the yum installer so:
FROM amazon/aws-lambda-python:3.8RUN yum -y install gcc gcc-c++RUN pip3 install --upgrade pipRUN pip3 install matplotlib
the fix was to add compiler tools to the docker image before trying to compile matplotlib. I still don't know why this started failing for me, perhaps the base image was updated.
RUN yum -y groups mark install "Development Tools" && yum -y groups mark convert "Development Tools" && yum -y group install "Development Tools"
I'm running into the same issue and I think it is matplotlib's fault. They released a new version (3.4.3) 17h ago as of this writing. For me setting the version to the previous minor release, i.e. matplotlib==3.4.2
fixes it.
There were no issues until today with my lambda deployment and nothing in my code changed so I think it's something in the new release though I do not know what exactly.