Ask questionsNew lambci:build-python3.7 image doesn't seem compatible with aws lambda us-west-2


When taking same code zip package created with latest lambci:build-python3.7 image. I am getting below exception inside us-west-2 deployments. This does not happen with us-east-1 deployments.

I believe this may be a bug with us-west-2 execution environment or us-east-1 is on some canary or something. I am raising an AWS ticket for this.

[ERROR] Runtime.ImportModuleError: Unable to import module 'redacted': No module named 'chardet'

Additional Notes

  1. When I downloaded the code zip from the lambda console us-east-1 and us-west-2 i see that there is a significant size difference in the code zips.
us-east-1 size: 9684109 bytes
us-west-2 size: 9333135 bytes
  1. If I take the downloaded west code zip and upload it to east; it will work fine.

  2. If i take the downloaded east code zip and upload it to west; it will also work fine.

  3. If i reupload the west code zip to west; it will resort back to the aformentioned error message.


For now I resorted back to an older copy I had of lambci:build-python3.7 I had pulled from 4 months ago and that is resolving my issue 100%.

I am wondering if this is related to some changes in


Answer questions mhart

Have pushed up new python build images that remove PYTHONPATH. The older images (with PYTHONPATH set) can be found at:

  • lambci/lambda:20200512-build-python2.7
  • lambci/lambda:20200512-build-python3.6
  • lambci/lambda:20200512-build-python3.7
  • lambci/lambda:20200512-build-python3.8

I'm hoping this won't break anyone's workflow (it should do the opposite) – although it may mean your bundles are slightly larger, but I think this should be a good thing™


Related questions

OPENSSL_1.0.2 not found for python 3.6 hot 1
Github User Rank List