- Newest
- Most votes
- Most comments
Hi,
Lambda requires packages built for a specific architecture. Many packages have distributions for multiple architectures (see https://pypi.org/project/pydantic-core/#files for pydantic-core). By default, pip installs the distribution suitable for the machine where you are running it on, which is not necessary the same architecture as your Lambda.
But you can force pip to install packages for the architecture you want. If your Lambda uses x86_64, then you should select platform manylinux2014_x86_64:
pip install pydantic-core --platform manylinux2014_x86_64 -t . --only-binary=:all:
-t . - means install in the current directory.
However, the best way is to install all your dependencies with the required platform, rather than doing it for each package.
pip install -r requirements.txt --platform manylinux2014_x86_64 --target ./python -
Credit to this answer: https://stackoverflow.com/questions/77210131/can-i-force-pip-to-install-dependencies-for-x86-64-architecture-in-powershell-to/77210143#77210143
Best,
Didier
Relevant content
- asked 2 years ago
- asked 2 years ago
- asked 9 months ago
- asked 2 years ago
