AWS Lambda (Python 3.12 / AL2023)
Runtime.ImportModuleError: Unable to import module: invalid ELF header (_rust.abi3.so)
A compiled Python wheel (commonly cryptography, pydantic_core, or orjson) was packaged on macOS, Windows, or the wrong CPU architecture instead of Amazon Linux 2023 Linux.
Upgrading from `python3.9`/`python3.10` (AL2) to `python3.12`/`python3.13` (AL2023) often coincides with rebuilding deployment ZIPs or switching to Graviton2 (`arm64`). Running `pip install -t package/` on a developer laptop bundles Mach-O (`.so` compiled for macOS) or `x86_64` ELF binaries that fail at Lambda cold start with `invalid ELF header`.
Related deadline: Lambda Python 3.10 create/update restrictions — 2027-07-29.
Fixing one function by hand rarely clears the whole stack. Download the $79 Offline Migration & Audit Toolkit to run air-gapped repo/IaC audits, Python 3.12/3.13 & AWS SDK v3 codemods, AL2023 native wheel Dockerfiles, and canary rollback templates with zero source upload (US buyers only · 30-day full refund policy).
Buy $79 Offline Toolkit (Instant Download) → Full specs & sample
The free EOLkits scanner processes files in your browser and flags selected related patterns in supported IaC and dependency files. File names and contents are not uploaded; bounded aggregate file and finding counts may be sent. It is not a complete source or AWS-account scan.
Prefer a 10-second check? Paste your config into the free AWS EOL checker. Pasted input is not uploaded; bounded first-party usage events may be sent.
Primary source: https://docs.aws.amazon.com/lambda/latest/dg/python-package.html