We recently switched out our lambda build image to a debian based image and started receiving errors around glibc.
[ERROR] Runtime.ImportModuleError. Unable to import module 'app': /lib64/lib.so.6: version 'GLIBC_2.28' not found (required by /var/task/cryptography/hazmat/bidnings/_rust.abi3.so)
After some googling we realized pip chooses the correct wheel for us and since we were running pip on a different machine than we were running our Python program on, we needed to let pip know about this.
RHEL/CentOS are using manylinux2014 which is what we need to pass to
Additionally we do not want to use source packages, so we had to pass
Our final command ended up being
python3 -m pip install --platform manylinux2014_x86_64 --only-binary=:all: -r requirements.txt