aws-sam-cli icon indicating copy to clipboard operation
aws-sam-cli copied to clipboard

Bug: Error: PythonPipBuilder:ResolveDependencies - {numpy==2.3.0(wheel)}

Open surenn opened this issue 5 months ago • 2 comments

Description:

sam build returns this error

Steps to reproduce:

SAM CLI, version 1.123.0 python version 3.12 sam build (or sam build --use-container)

Observed result:

Fetching public.ecr.aws/sam/build-python3.12:latest-x86_64 Docker container image...... 2025-06-13 08:31:26,375 | Mounting
/Users/surendranichenametla/Documents/workspace/oasis-dbt-analytics/aws_lambda/functions/layers as
/tmp/samcli/source:ro,delegated, inside runtime container
Using the request object from command line argument Loading workflow module 'aws_lambda_builders.workflows' Registering workflow 'CustomMakeBuilder' with capability 'Capability(language='provided', dependency_manager=None, application_framework=None)' Registering workflow 'DotnetCliPackageBuilder' with capability 'Capability(language='dotnet', dependency_manager='cli-package', application_framework=None)' Registering workflow 'GoModulesBuilder' with capability 'Capability(language='go', dependency_manager='modules', application_framework=None)' Registering workflow 'JavaGradleWorkflow' with capability 'Capability(language='java', dependency_manager='gradle', application_framework=None)' Registering workflow 'JavaMavenWorkflow' with capability 'Capability(language='java', dependency_manager='maven', application_framework=None)' Registering workflow 'NodejsNpmBuilder' with capability 'Capability(language='nodejs', dependency_manager='npm', application_framework=None)' Registering workflow 'NodejsNpmEsbuildBuilder' with capability 'Capability(language='nodejs', dependency_manager='npm-esbuild', application_framework=None)' Registering workflow 'PythonPipBuilder' with capability 'Capability(language='python', dependency_manager='pip', application_framework=None)' Registering workflow 'RubyBundlerBuilder' with capability 'Capability(language='ruby', dependency_manager='bundler', application_framework=None)' Registering workflow 'RustCargoLambdaBuilder' with capability 'Capability(language='rust', dependency_manager='cargo', application_framework=None)' Found workflow 'PythonPipBuilder' to support capabilities 'Capability(language='python', dependency_manager='pip', application_framework=None)' Running workflow 'PythonPipBuilder' Running PythonPipBuilder:ResolveDependencies calling pip download -r /tmp/samcli/source/requirements.txt --dest /tmp/samcli/scratch --exists-action i pip stdout: b'Collecting boto3==1.34.90 (from -r /tmp/samcli/source/requirements.txt (line 1))\n Downloading boto3-1.34.90-py3-none-any.whl.metadata (6.6 kB)\nCollecting botocore==1.34.162 (from -r /tmp/samcli/source/requirements.txt (line 2))\n Downloading botocore-1.34.162-py3-none-any.whl.metadata (5.7 kB)\nCollecting DateTime==5.4 (from -r /tmp/samcli/source/requirements.txt (line 3))\n Downloading DateTime-5.4-py3-none-any.whl.metadata (33 kB)\nCollecting python-dateutil==2.8.2 (from -r /tmp/samcli/source/requirements.txt (line 4))\n Downloading python_dateutil-2.8.2-py2.py3-none-any.whl.metadata (8.2 kB)\nCollecting pytz==2024.1 (from -r /tmp/samcli/source/requirements.txt (line 5))\n Downloading pytz-2024.1-py2.py3-none-any.whl.metadata (22 kB)\nCollecting pandas==2.2.2 (from -r /tmp/samcli/source/requirements.txt (line 6))\n Downloading pandas-2.2.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (19 kB)\nCollecting openpyxl==3.1.2 (from -r /tmp/samcli/source/requirements.txt (line 7))\n Downloading openpyxl-3.1.2-py2.py3-none-any.whl.metadata (2.5 kB)\nCollecting requests==2.32.3 (from -r /tmp/samcli/source/requirements.txt (line 8))\n Downloading requests-2.32.3-py3-none-any.whl.metadata (4.6 kB)\nCollecting jmespath<2.0.0,>=0.7.1 (from boto3==1.34.90->-r /tmp/samcli/source/requirements.txt (line 1))\n Downloading jmespath-1.0.1-py3-none-any.whl.metadata (7.6 kB)\nCollecting s3transfer<0.11.0,>=0.10.0 (from boto3==1.34.90->-r /tmp/samcli/source/requirements.txt (line 1))\n Downloading s3transfer-0.10.4-py3-none-any.whl.metadata (1.7 kB)\nCollecting urllib3!=2.2.0,<3,>=1.25.4 (from botocore==1.34.162->-r /tmp/samcli/source/requirements.txt (line 2))\n Downloading urllib3-2.4.0-py3-none-any.whl.metadata (6.5 kB)\nCollecting zope.interface (from DateTime==5.4->-r /tmp/samcli/source/requirements.txt (line 3))\n Downloading zope.interface-7.2-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (44 kB)\nCollecting six>=1.5 (from python-dateutil==2.8.2->-r /tmp/samcli/source/requirements.txt (line 4))\n Downloading six-1.17.0-py2.py3-none-any.whl.metadata (1.7 kB)\nCollecting numpy>=1.26.0 (from pandas==2.2.2->-r /tmp/samcli/source/requirements.txt (line 6))\n Downloading numpy-2.3.0-cp312-cp312-manylinux_2_28_x86_64.whl.metadata (62 kB)\nCollecting tzdata>=2022.7 (from pandas==2.2.2->-r /tmp/samcli/source/requirements.txt (line 6))\n Downloading tzdata-2025.2-py2.py3-none-any.whl.metadata (1.4 kB)\nCollecting et-xmlfile (from openpyxl==3.1.2->-r /tmp/samcli/source/requirements.txt (line 7))\n Downloading et_xmlfile-2.0.0-py3-none-any.whl.metadata (2.7 kB)\nCollecting charset-normalizer<4,>=2 (from requests==2.32.3->-r /tmp/samcli/source/requirements.txt (line 8))\n Downloading charset_normalizer-3.4.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (35 kB)\nCollecting idna<4,>=2.5 (from requests==2.32.3->-r /tmp/samcli/source/requirements.txt (line 8))\n Downloading idna-3.10-py3-none-any.whl.metadata (10 kB)\nCollecting certifi>=2017.4.17 (from requests==2.32.3->-r /tmp/samcli/source/requirements.txt (line 8))\n Downloading certifi-2025.4.26-py3-none-any.whl.metadata (2.5 kB)\nCollecting setuptools (from zope.interface->DateTime==5.4->-r /tmp/samcli/source/requirements.txt (line 3))\n Using cached setuptools-80.9.0-py3-none-any.whl.metadata (6.6 kB)\nDownloading boto3-1.34.90-py3-none-any.whl (139 kB)\nDownloading botocore-1.34.162-py3-none-any.whl (12.5 MB)\n \xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81 12.5/12.5 MB 15.5 MB/s eta 0:00:00\nDownloading DateTime-5.4-py3-none-any.whl (52 kB)\nDownloading python_dateutil-2.8.2-py2.py3-none-any.whl (247 kB)\nDownloading pytz-2024.1-py2.py3-none-any.whl (505 kB)\nDownloading pandas-2.2.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (12.7 MB)\n \xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81 12.7/12.7 MB 16.9 MB/s eta 0:00:00\nDownloading openpyxl-3.1.2-py2.py3-none-any.whl (249 kB)\nDownloading requests-2.32.3-py3-none-any.whl (64 kB)\nDownloading certifi-2025.4.26-py3-none-any.whl (159 kB)\nDownloading charset_normalizer-3.4.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (148 kB)\nDownloading idna-3.10-py3-none-any.whl (70 kB)\nDownloading jmespath-1.0.1-py3-none-any.whl (20 kB)\nDownloading numpy-2.3.0-cp312-cp312-manylinux_2_28_x86_64.whl (16.6 MB)\n \xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81 16.6/16.6 MB 16.1 MB/s eta 0:00:00\nDownloading s3transfer-0.10.4-py3-none-any.whl (83 kB)\nDownloading six-1.17.0-py2.py3-none-any.whl (11 kB)\nDownloading tzdata-2025.2-py2.py3-none-any.whl (347 kB)\nDownloading urllib3-2.4.0-py3-none-any.whl (128 kB)\nDownloading et_xmlfile-2.0.0-py3-none-any.whl (18 kB)\nDownloading zope.interface-7.2-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (264 kB)\nUsing cached setuptools-80.9.0-py3-none-any.whl (1.2 MB)\nSaved /tmp/samcli/scratch/boto3-1.34.90-py3-none-any.whl\nSaved /tmp/samcli/scratch/botocore-1.34.162-py3-none-any.whl\nSaved /tmp/samcli/scratch/DateTime-5.4-py3-none-any.whl\nSaved /tmp/samcli/scratch/python_dateutil-2.8.2-py2.py3-none-any.whl\nSaved /tmp/samcli/scratch/pytz-2024.1-py2.py3-none-any.whl\nSaved /tmp/samcli/scratch/pandas-2.2.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl\nSaved /tmp/samcli/scratch/openpyxl-3.1.2-py2.py3-none-any.whl\nSaved /tmp/samcli/scratch/requests-2.32.3-py3-none-any.whl\nSaved /tmp/samcli/scratch/certifi-2025.4.26-py3-none-any.whl\nSaved /tmp/samcli/scratch/charset_normalizer-3.4.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl\nSaved /tmp/samcli/scratch/idna-3.10-py3-none-any.whl\nSaved /tmp/samcli/scratch/jmespath-1.0.1-py3-none-any.whl\nSaved /tmp/samcli/scratch/numpy-2.3.0-cp312-cp312-manylinux_2_28_x86_64.whl\nSaved /tmp/samcli/scratch/s3transfer-0.10.4-py3-none-any.whl\nSaved /tmp/samcli/scratch/six-1.17.0-py2.py3-none-any.whl\nSaved /tmp/samcli/scratch/tzdata-2025.2-py2.py3-none-any.whl\nSaved /tmp/samcli/scratch/urllib3-2.4.0-py3-none-any.whl\nSaved /tmp/samcli/scratch/et_xmlfile-2.0.0-py3-none-any.whl\nSaved /tmp/samcli/scratch/zope.interface-7.2-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl\nSaved /tmp/samcli/scratch/setuptools-80.9.0-py3-none-any.whl\nSuccessfully downloaded boto3 botocore DateTime python-dateutil pytz pandas openpyxl requests certifi charset-normalizer idna jmespath numpy s3transfer six tzdata urllib3 et-xmlfile zope.interface setuptools\n' pip stderr: b"WARNING: pip is being invoked by an old script wrapper. This will fail in a future version of pip.\nPlease see https://github.com/pypa/pip/issues/5599 for advice on fixing the underlying issue.\nTo avoid this problem you can invoke Python with '-m pip' instead of running pip directly.\n\n[notice] A new release of pip is available: 24.3.1 -> 25.1.1\n[notice] To update, run: pip install --upgrade pip\n" Full dependency closure: {numpy==2.3.0(wheel), pytz==2024.1(wheel), tzdata==2025.2(wheel), requests==2.32.3(wheel), pandas==2.2.2(wheel), jmespath==1.0.1(wheel), boto3==1.34.90(wheel), idna==3.10(wheel), et-xmlfile==2.0.0(wheel), openpyxl==3.1.2(wheel), charset-normalizer==3.4.2(wheel), s3transfer==0.10.4(wheel), certifi==2025.4.26(wheel), python-dateutil==2.8.2(wheel), zope-interface==7.2(wheel), botocore==1.34.162(wheel), six==1.17.0(wheel), setuptools==80.9.0(wheel), datetime==5.4(wheel), urllib3==2.4.0(wheel)} initial compatible: {pytz==2024.1(wheel), tzdata==2025.2(wheel), requests==2.32.3(wheel), pandas==2.2.2(wheel), jmespath==1.0.1(wheel), boto3==1.34.90(wheel), idna==3.10(wheel), et-xmlfile==2.0.0(wheel), openpyxl==3.1.2(wheel), charset-normalizer==3.4.2(wheel), s3transfer==0.10.4(wheel), certifi==2025.4.26(wheel), python-dateutil==2.8.2(wheel), zope-interface==7.2(wheel), botocore==1.34.162(wheel), six==1.17.0(wheel), setuptools==80.9.0(wheel), datetime==5.4(wheel), urllib3==2.4.0(wheel)} initial incompatible: {numpy==2.3.0(wheel)} Downloading missing wheels: {numpy==2.3.0(wheel)} calling pip download --only-binary=:all: --no-deps --platform manylinux2014_x86_64 --implementation cp --abi cp312 --dest /tmp/samcli/scratch numpy==2.3.0 pip stdout: b'' pip stderr: b"WARNING: pip is being invoked by an old script wrapper. This will fail in a future version of pip.\nPlease see https://github.com/pypa/pip/issues/5599 for advice on fixing the underlying issue.\nTo avoid this problem you can invoke Python with '-m pip' instead of running pip directly.\nERROR: Could not find a version that satisfies the requirement numpy==2.3.0 (from versions: 1.26.0, 1.26.1, 1.26.2, 1.26.3, 1.26.4, 2.0.0, 2.0.1, 2.0.2, 2.1.0rc1, 2.1.0, 2.1.1, 2.1.2, 2.1.3, 2.2.0rc1, 2.2.0, 2.2.1, 2.2.2, 2.2.3, 2.2.4, 2.2.5, 2.2.6)\n\n[notice] A new release of pip is available: 24.3.1 -> 25.1.1\n[notice] To update, run: pip install --upgrade pip\nERROR: No matching distribution found for numpy==2.3.0\n" compatible wheels after second download pass: {pytz==2024.1(wheel), tzdata==2025.2(wheel), requests==2.32.3(wheel), pandas==2.2.2(wheel), jmespath==1.0.1(wheel), boto3==1.34.90(wheel), idna==3.10(wheel), et-xmlfile==2.0.0(wheel), openpyxl==3.1.2(wheel), charset-normalizer==3.4.2(wheel), s3transfer==0.10.4(wheel), certifi==2025.4.26(wheel), python-dateutil==2.8.2(wheel), zope-interface==7.2(wheel), botocore==1.34.162(wheel), six==1.17.0(wheel), setuptools==80.9.0(wheel), datetime==5.4(wheel), urllib3==2.4.0(wheel)} Build missing wheels from sdists (C compiling True): set() compatible after building wheels (no C compiling): {pytz==2024.1(wheel), tzdata==2025.2(wheel), requests==2.32.3(wheel), pandas==2.2.2(wheel), jmespath==1.0.1(wheel), boto3==1.34.90(wheel), idna==3.10(wheel), et-xmlfile==2.0.0(wheel), openpyxl==3.1.2(wheel), charset-normalizer==3.4.2(wheel), s3transfer==0.10.4(wheel), certifi==2025.4.26(wheel), python-dateutil==2.8.2(wheel), zope-interface==7.2(wheel), botocore==1.34.162(wheel), six==1.17.0(wheel), setuptools==80.9.0(wheel), datetime==5.4(wheel), urllib3==2.4.0(wheel)} Build missing wheels from sdists (C compiling False): set() compatible after building wheels (C compiling): {pytz==2024.1(wheel), tzdata==2025.2(wheel), requests==2.32.3(wheel), pandas==2.2.2(wheel), jmespath==1.0.1(wheel), boto3==1.34.90(wheel), idna==3.10(wheel), et-xmlfile==2.0.0(wheel), openpyxl==3.1.2(wheel), charset-normalizer==3.4.2(wheel), s3transfer==0.10.4(wheel), certifi==2025.4.26(wheel), python-dateutil==2.8.2(wheel), zope-interface==7.2(wheel), botocore==1.34.162(wheel), six==1.17.0(wheel), setuptools==80.9.0(wheel), datetime==5.4(wheel), urllib3==2.4.0(wheel)} Final compatible: {idna==3.10(wheel), et-xmlfile==2.0.0(wheel), pytz==2024.1(wheel), openpyxl==3.1.2(wheel), charset-normalizer==3.4.2(wheel), s3transfer==0.10.4(wheel), urllib3==2.4.0(wheel), tzdata==2025.2(wheel), requests==2.32.3(wheel), certifi==2025.4.26(wheel), python-dateutil==2.8.2(wheel), zope-interface==7.2(wheel), botocore==1.34.162(wheel), six==1.17.0(wheel), setuptools==80.9.0(wheel), pandas==2.2.2(wheel), datetime==5.4(wheel), jmespath==1.0.1(wheel), boto3==1.34.90(wheel)} Final incompatible: {numpy==2.3.0(wheel)} Final missing wheels: {numpy==2.3.0(wheel)} PythonPipBuilder:ResolveDependencies failed Traceback (most recent call last): File "/usr/local/opt/lambda-builders/lib/python3.12/site-packages/aws_lambda_builders/workflows/python_pip/actions.py", line 71, in execute package_builder.build_dependencies( File "/usr/local/opt/lambda-builders/lib/python3.12/site-packages/aws_lambda_builders/workflows/python_pip/packager.py", line 158, in build_dependencies self._dependency_builder.build_site_packages(requirements_path, artifacts_dir_path, scratch_dir_path) File "/usr/local/opt/lambda-builders/lib/python3.12/site-packages/aws_lambda_builders/workflows/python_pip/packager.py", line 266, in build_site_packages raise MissingDependencyError(packages_without_wheels) aws_lambda_builders.workflows.python_pip.packager.MissingDependencyError: {numpy==2.3.0(wheel)}

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/local/opt/lambda-builders/lib/python3.12/site-packages/aws_lambda_builders/workflow.py", line 374, in run action.execute() File "/usr/local/opt/lambda-builders/lib/python3.12/site-packages/aws_lambda_builders/workflows/python_pip/actions.py", line 77, in execute raise ActionFailedError(str(ex)) aws_lambda_builders.actions.ActionFailedError: {numpy==2.3.0(wheel)} Builder workflow failed Traceback (most recent call last): File "/usr/local/opt/lambda-builders/lib/python3.12/site-packages/aws_lambda_builders/workflows/python_pip/actions.py", line 71, in execute package_builder.build_dependencies( File "/usr/local/opt/lambda-builders/lib/python3.12/site-packages/aws_lambda_builders/workflows/python_pip/packager.py", line 158, in build_dependencies self._dependency_builder.build_site_packages(requirements_path, artifacts_dir_path, scratch_dir_path) File "/usr/local/opt/lambda-builders/lib/python3.12/site-packages/aws_lambda_builders/workflows/python_pip/packager.py", line 266, in build_site_packages raise MissingDependencyError(packages_without_wheels) aws_lambda_builders.workflows.python_pip.packager.MissingDependencyError: {numpy==2.3.0(wheel)}

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/local/opt/lambda-builders/lib/python3.12/site-packages/aws_lambda_builders/workflow.py", line 374, in run action.execute() File "/usr/local/opt/lambda-builders/lib/python3.12/site-packages/aws_lambda_builders/workflows/python_pip/actions.py", line 77, in execute raise ActionFailedError(str(ex)) aws_lambda_builders.actions.ActionFailedError: {numpy==2.3.0(wheel)}

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/local/opt/lambda-builders/lib/python3.12/site-packages/aws_lambda_builders/main.py", line 117, in main builder.build( File "/usr/local/opt/lambda-builders/lib/python3.12/site-packages/aws_lambda_builders/builder.py", line 172, in build return workflow.run() ^^^^^^^^^^^^^^ File "/usr/local/opt/lambda-builders/lib/python3.12/site-packages/aws_lambda_builders/workflow.py", line 116, in wrapper func(self, *args, **kwargs) File "/usr/local/opt/lambda-builders/lib/python3.12/site-packages/aws_lambda_builders/workflow.py", line 381, in run raise WorkflowFailedError(workflow_name=self.NAME, action_name=action.NAME, reason=str(ex)) aws_lambda_builders.exceptions.WorkflowFailedError: PythonPipBuilder:ResolveDependencies - {numpy==2.3.0(wheel)} 2025-06-13 08:31:35,110 | Build inside container returned response {"jsonrpc": "2.0", "id": 1, "error": {"code": 400,
"message": "PythonPipBuilder:ResolveDependencies - {numpy==2.3.0(wheel)}"}}
2025-06-13 08:31:35,316 | Exception raised during the execution

Build Failed

Expected result:

sam build succeed

Additional environment details (Ex: Windows, Mac, Amazon Linux etc)

  1. OS:
  2. sam --version: SAM CLI, version 1.123.0
  3. AWS region: us-east-1
# Paste the output of `sam --info` here

{ "version": "1.123.0", "system": { "python": "3.8.13", "os": "macOS-15.5-arm64-arm-64bit" }, "additional_dependencies": { "docker_engine": "27.4.0", "aws_cdk": "Not available", "terraform": "Not available" }, "available_beta_feature_env_vars": [ "SAM_CLI_BETA_FEATURES", "SAM_CLI_BETA_BUILD_PERFORMANCE", "SAM_CLI_BETA_TERRAFORM_SUPPORT", "SAM_CLI_BETA_RUST_CARGO_LAMBDA" ] }

Add --debug flag to command you are running

surenn avatar Jun 13 '25 13:06 surenn

Encountering this same issue and I've tried just about everything. In CI, on various machines, with or without pyenv, etc.

matt-inkind avatar Jun 16 '25 05:06 matt-inkind

The issue comes from the release of numpy itself.

The new version only has manylinux_2_28_x86_64 wheels, while previous version did have a wheel for manylinux2014_x86_64.

sam build's pip wants both --platform manylinux2014_x86_64 and --only-binary=:all: which doesn't exist on numpy==2.3.0, installing from source would work, but would also need a compiler installed.

ljmc-github avatar Jun 16 '25 09:06 ljmc-github

I was able to circumvent the issue by specifying numpy==2.2.6 in the requirements.txt file.

wp-kubo avatar Jun 19 '25 19:06 wp-kubo

This is caused by aws-lambda-builders assuming manylinux2014 is the runtime for a lambda on Python 3.12 & 3.13 when instead manylinux_2_34 is available.

See aws/aws-lambda-builders#752 for the fix, which is now available in v1.55.0. #8130 will fix this.

piscoTech avatar Jun 26 '25 18:06 piscoTech

The new release of SAM CLI includes the fixed version of aws-lambda-builders 1.142.1. Please let us know if someone is still experiencing this issue

valerena avatar Jul 01 '25 22:07 valerena

Does not work for when building arm lambda function from an x86 host because aws-lambda-builders is not figuring out the --platform correctly (should be manylinux_2_28_aarch64) for this scenario. Building an arm function from x86 host does work for numpy<2.3.

sam build --debug

calling pip download --only-binary=:all: --no-deps --platform manylinux2014_aarch64 --implementation cp --abi cp312 --dest /tmp/tmpww9d4jjk numpy==2.3.1

jeffcarrico avatar Jul 02 '25 04:07 jeffcarrico

This is interesting, because even though 2_28 is the version we need, AL2023 (python 3.12 and 3.13) actually have GLIBC 2_34. Of course, they're compatible, but it makes things more complicated.

The way that aws-lambda-builders work is: after downloading the default version of the packages and checking what's actually compatible with the target architecture, for the packages that are missing, it asks pip for the exact platform version to download. Currently it just asks for manylinux2014 for all the packages, which is old so we should definitely improve that because of packages stopping that support, like numpy just did. However, the problem comes when we try to see which version to get, because in this case, if we try to get 2_34, the download will still fail.

I don't see a way to get the "list of available platforms" for a particular package version (like numpy==2.3.1), so it feels like the solution would be to just try to download each possible version starting on the one supported (2_34) and then going down until we find one that is available for the requested package (2_33, 2_32, 2_31, 2_30, 2_29, 2_28<--)

It's probably not the best solution ever, but it's definitely better than "not working", but it will also require a little more effort.

valerena avatar Jul 03 '25 23:07 valerena

Hi @valerena, thanks for the update, I managed to reproduce the error on aws-sam-cli version 1.55.0, so I drafted this PR on aws-lambda-builders to address it. The new logic considers only the official supported versions of manylinux, which as of today are 2_17, 2_28 and 2_34. This means that, for example, a package providing the non-officially supported manylinux_2_31 wheel won't be dowloaded under the current implementation. I tested on my arm64 mac, and I was able to build a python 3.12 lambda with numpy==2.3.0, targeting both x86_64 and arm64 architectures.

alesanfra avatar Jul 14 '25 10:07 alesanfra

I was getting this same issue using Python 3.13. You need to use numpy ==2.1.0 as this version provides pre-built wheels with support for Python 3.13.

aryash14 avatar Aug 13 '25 20:08 aryash14

Already addressed https://github.com/numpy/numpy/issues/29150#issuecomment-2962067829

affan-novumai avatar Sep 02 '25 01:09 affan-novumai