- Newest
- Most votes
- Most comments
It looks like you're encountering an issue with package dependencies when building your Python Lambda function. The error is occurring during the dependency resolution phase of your build process.
The specific error relates to numpy and pandas wheel packages. The issue is likely due to compatibility problems between the versions being installed. The error message shows it's trying to use numpy==2.3.5 and pandas==2.3.3, but numpy 2.3.5 doesn't exist (the latest stable version is around 1.26.x as of writing).
Here are some solutions to try:
- Pin specific compatible versions in your requirements.txt file:
pandas==2.0.3
numpy==1.24.3
python-dotenv
boto3
requests
-
Make sure you're building your Lambda package in an environment that matches the Lambda runtime (Python 3.11 in your case). Architecture mismatches can cause compiled extensions to fail.
-
Consider using Lambda Layers for large dependencies like pandas and numpy to reduce your deployment package size.
-
If you're using a local development environment that differs from the Lambda runtime, try using a Docker container that matches the Lambda environment for building your package.
These steps should help resolve the dependency resolution error you're experiencing with pandas and numpy.
Sources
Troubleshooting - Powertools for AWS Lambda (Python)
Troubleshooting - Powertools for AWS Lambda (Python)
It is essentially trying to download the latest panda and numpy versions as dependencies which are not compatible to Python 11 Lambda runtime. You need to pin the version number in requirements.txt file and use a lower version.
pandas==2.1.4
numpy==1.26.4
python-dotenv
boto3
requests
Relevant content
- AWS OFFICIALUpdated 4 months ago
- AWS OFFICIALUpdated 5 years ago
