numpy / numpy/numpy

No wheels for NumPy 2.3.0 on amazon linux 2 AWS lambda image

Open
#29,150 10 comments 20 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

32 - Installation
Dominant language
Python
Stars
32.8k
Forks
12.8k
Avg merge
1d 7h
Merged PRs (30d)
197

Description

Steps to reproduce:
  1. Use the public.ecr.aws/lambda/python:3.11 Docker base image.
  2. In a Dockerfile, copy in a requirements.txt containing numpy
  3. Run pip install -r requirements.txt.
  4. Observe that pip falls back to building NumPy 2.3.0 from source and fails due to missing C compiler.
Error message:
#7 2.842   Downloading numpy-2.3.0.tar.gz (20.4 MB)
#7 2.990      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 20.4/20.4 MB 132.5 MB/s eta 0:00:00
#7 5.039   Installing build dependencies: started
#7 7.540   Installing build dependencies: finished with status 'done'
#7 7.540   Getting requirements to build wheel: started
#7 7.639   Getting requirements to build wheel: finished with status 'done'
#7 7.644   Installing backend dependencies: started
#7 8.255   Installing backend dependencies: finished with status 'done'
#7 8.256   Preparing metadata (pyproject.toml): started
#7 9.146   Preparing metadata (pyproject.toml): finished with status 'error'
#7 9.151   error: subprocess-exited-with-error
#7 9.151   
#7 9.151   × Preparing metadata (pyproject.toml) did not run successfully.
#7 9.151   │ exit code: 1
#7 9.151   ╰─> [20 lines of output]
#7 9.151       + /var/lang/bin/python3.11 /tmp/pip-install-pv61bimt/numpy_a2374ad6e38d46daba33ed2d9893ca9c/vendored-meson/meson/meson.py setup /tmp/pip-install-pv61bimt/numpy_a2374ad6e38d46daba33ed2d9893ca9c /tmp/pip-install-pv61bimt/numpy_a2374ad6e38d46daba33ed2d9893ca9c/.mesonpy-rw0po2ou -Dbuildtype=release -Db_ndebug=if-release -Db_vscrt=md --native-file=/tmp/pip-install-pv61bimt/numpy_a2374ad6e38d46daba33ed2d9893ca9c/.mesonpy-rw0po2ou/meson-python-native-file.ini
#7 9.151       The Meson build system
#7 9.151       Version: 1.6.1
#7 9.151       Source dir: /tmp/pip-install-pv61bimt/numpy_a2374ad6e38d46daba33ed2d9893ca9c
#7 9.151       Build dir: /tmp/pip-install-pv61bimt/numpy_a2374ad6e38d46daba33ed2d9893ca9c/.mesonpy-rw0po2ou
#7 9.151       Build type: native build
#7 9.151       Project name: NumPy
#7 9.151       Project version: 2.3.0
#7 9.151       
#7 9.151       ../meson.build:1:0: ERROR: Unknown compiler(s): [['cc'], ['gcc'], ['clang'], ['nvc'], ['pgcc'], ['icc'], ['icx']]
#7 9.151       The following exception(s) were encountered:
#7 9.151       Running `cc --version` gave "[Errno 2] No such file or directory: 'cc'"
#7 9.151       Running `gcc --version` gave "[Errno 2] No such file or directory: 'gcc'"
#7 9.151       Running `clang --version` gave "[Errno 2] No such file or directory: 'clang'"
#7 9.151       Running `nvc --version` gave "[Errno 2] No such file or directory: 'nvc'"
#7 9.151       Running `pgcc --version` gave "[Errno 2] No such file or directory: 'pgcc'"
#7 9.151       Running `icc --version` gave "[Errno 2] No such file or directory: 'icc'"
#7 9.151       Running `icx --version` gave "[Errno 2] No such file or directory: 'icx'"
#7 9.151       
#7 9.151       A full log can be found at /tmp/pip-install-pv61bimt/numpy_a2374ad6e38d46daba33ed2d9893ca9c/.mesonpy-rw0po2ou/meson-logs/meson-log.txt
#7 9.151       [end of output]
#7 9.151   
#7 9.151   note: This error originates from a subprocess, and is likely not a problem with pip.
#7 9.153 error: metadata-generation-failed
#7 9.153 
#7 9.153 × Encountered error while generating package metadata.
#7 9.153 ╰─> See above for output.
#7 9.153 
#7 9.153 note: This is an issue with the package mentioned above, not pip.
#7 9.153 hint: See above for details.
#7 9.162 
#7 9.162 [notice] A new release of pip is available: 24.0 -> 25.1.1
#7 9.162 [notice] To update, run: pip install --upgrade pip
#7 ERROR: process "/bin/sh -c pip install -r requirements.txt" did not complete successfully: exit code: 1
------
 > [3/5] RUN pip install -r requirements.txt:
9.153 error: metadata-generation-failed
9.153 
9.153 × Encountered error while generating package metadata.
9.153 ╰─> See above for output.
9.153 
9.153 note: This is an issue with the package mentioned above, not pip.
9.153 hint: See above for details.
Additional information:

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Dockerfile using public.ecr.aws/lambda/python:3.11 and the requirements.txt containing numpy, then reproduce the pip install failure. Check the available NumPy 2.3.0 distributions for this environment and the package’s wheel-building or release configuration. Done means pip can install NumPy in the stated Lambda image without requiring an unavailable compiler.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, docker, python
Domain
build-system, cloud, infrastructure
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.