[Python] While installing numpy, `../meson.build:1:0: ERROR: Compiler cc cannot compile...

Discussão em 'Python' iniciado por Stack, Maio 16, 2025.

  1. Stack

    Stack Membro Participativo

    When I ran pip install numpy==2.0.0 in my docker container, following error happened.

    # pip install numpy==2.0.0
    Collecting numpy==2.0.0
    Downloading numpy-2.0.0.tar.gz (18.3 MB)
    ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 18.3/18.3 MB 35.3 MB/s eta 0:00:00
    Installing build dependencies ... done
    Getting requirements to build wheel ... done
    Installing backend dependencies ... done
    Preparing metadata (pyproject.toml) ... error
    error: subprocess-exited-with-error

    × Preparing metadata (pyproject.toml) did not run successfully.
    │ exit code: 1
    ╰─> [12 lines of output]
    + /usr/local/bin/python3.13 /tmp/pip-install-l4g9wf4v/numpy_5970e636fac947f4876fa7f4f02504f9/vendored-meson/meson/meson.py setup /tmp/pip-install-l4g9wf4v/numpy_5970e636fac947f4876fa7f4f02504f9 /tmp/pip-install-l4g9wf4v/numpy_5970e636fac947f4876fa7f4f02504f9/.mesonpy-fskz9xxu -Dbuildtype=release -Db_ndebug=if-release -Db_vscrt=md --native-file=/tmp/pip-install-l4g9wf4v/numpy_5970e636fac947f4876fa7f4f02504f9/.mesonpy-fskz9xxu/meson-python-native-file.ini
    The Meson build system
    Version: 1.2.99
    Source dir: /tmp/pip-install-l4g9wf4v/numpy_5970e636fac947f4876fa7f4f02504f9
    Build dir: /tmp/pip-install-l4g9wf4v/numpy_5970e636fac947f4876fa7f4f02504f9/.mesonpy-fskz9xxu
    Build type: native build
    Project name: NumPy
    Project version: 2.0.0

    ../meson.build:1:0: ERROR: Compiler cc cannot compile programs.

    A full log can be found at /tmp/pip-install-l4g9wf4v/numpy_5970e636fac947f4876fa7f4f02504f9/.mesonpy-fskz9xxu/meson-logs/meson-log.txt
    [end of output]

    note: This error originates from a subprocess, and is likely not a problem with pip.
    error: metadata-generation-failed

    × Encountered error while generating package metadata.
    ╰─> See above for output.

    note: This is an issue with the package mentioned above, not pip.
    hint: See above for details.


    How can I resolve the issue?

    Environmental Info


    I used these tools.

    tool version
    Host OS macOS 13.6
    Docker image python:3.13.3-slim
    Python 3.13.3
    numpy 2.0.0

    Continue reading...

Compartilhe esta Página