[Python] PEX Build Fails Due to Missing manylinux_2_17 or manylinux_2_27 Wheels for numpy and...

Discussão em 'Python' iniciado por Stack, Agosto 8, 2025.

  1. Stack

    Stack Membro Participativo

    I’m building a PEX file for a Python 3.12 project (system-monitor) targeting Amazon Linux 2023 (glibc 2.34) on both x86_64 and aarch64 architectures. I’m using PEX with --platform options to enforce manylinux tags, but I’m encountering issues with missing wheels for numpy and pandas depending on the tag used.

    Installing Packages with Poetry:

    I use poetry add numpy

    Output: installed latest version 2.3.2

    Steps Taken:

    1. Configured Poetry to manage dependencies and exported to requirements.txt.
    2. Ran the following PEX command with manylinux_2_17

    pex . -D dist -c system-monitor -r requirements.txt '--python-shebang=/usr/bin/env python3.12' \
    --platform manylinux_2_17_x86_64-cp-312-cp312 \
    --platform manylinux_2_17_aarch64-cp-312-cp312 \
    --no-build \
    -o pex_dist/system_monitor.pex


    Result: Failed for numpy 2.3.2 (no manylinux_2_17 wheel)

    1. Tried manylinux_2_27 to support newer numpy versions

    pex . -D dist -c system-monitor -r requirements.txt '--python-shebang=/usr/bin/env python3.12' \
    --platform manylinux_2_27_x86_64-cp-312-cp312 \
    --platform manylinux_2_27_aarch64-cp-312-cp312 \
    --no-build \
    -o pex_dist/system_monitor.pex


    Result: Failed for pandas (no manylinux_2_27 wheel)

    Errors: For numpy 2.3.2 with manylinux_2_17:

    pip: ERROR: Could not find a version that satisfies the requirement numpy==2.3.2 (from versions: 1.26.0, ..., 2.2.6)
    pip: ERROR: No matching distribution found for numpy==2.3.2


    For pandas with manylinux_2_27:

    pip: ERROR: Could not find a version that satisfies the requirement pandas (from versions: none for manylinux_2_27)
    pip: ERROR: No matching distribution found for pandas


    Tag Sync Issue

    numpy: Installing numpy via poetry add numpy or poetry install resolves to the latest version (e.g., 2.3.2), which has manylinux_2_27 or manylinux_2_28 wheels for Python 3.12, but not manylinux_2_17. Downgrading to 2.2.5 aligns with manylinux_2_17.

    pandas: Installing pandas via poetry add pandas or poetry install resolves to the latest version (e.g., 2.2.2), which has manylinux_2_17 wheels, but not manylinux_2_27. Newer versions might lack manylinux_2_27 support.

    Discrepancy: Poetry doesn’t synchronize the manylinux tag across dependencies. numpy moves to newer tags (e.g., manylinux_2_27) faster than pandas, leading to mismatches when PEX enforces a specific tag. This requires manual version adjustments or tag alignment.


    I Resolved by downgrading the numpy to 2.2.6 which as manylinux_2_17 and synced with other all dependencies.


    Question: How can I ensure all dependencies have consistent manylinux wheels (e.g., manylinux_2_17 or manylinux_2_27) for Python 3.12 without manual version tweaks? Can Poetry or PEX be configured to enforce a tag and adjust versions automatically?

    Continue reading...

Compartilhe esta Página