Skip to content

[Bug]: pypy3.9 wheel has hidden dependency on numpy>=1.23.0 #25811

Open
@jvesely

Description

@jvesely

Bug summary

The pypy3.9 wheel indicates dependency on numpy >=1.20.0, but in fact needs numpy >=1.23.0

Code for reproduction

$ ~/pypy39/pypy/goal/pypy3.9-c -m venv test-venv
$ source ~/test-venv/bin/activate
(test-venv) $ pip install -U pip wheel setuptools
(test-venv) $ pip install numpy==1.22.4
Collecting numpy==1.22.4
  Using cached numpy-1.22.4.zip (11.5 MB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: numpy
  Building wheel for numpy (pyproject.toml) ... done
  Created wheel for numpy: filename=numpy-1.22.4-pp39-pypy39_pp73-linux_x86_64.whl size=5838730 sha256=39acecdee26139b21ea2273993304465c9d67d88ec8b9900ce12630d224a1174
  Stored in directory: /home/$USER/.cache/pip/wheels/59/3a/25/8abbffc79457432dd0c73e1616ce79e808d5c92677524655e7
Successfully built numpy
Installing collected packages: numpy
Successfully installed numpy-1.22.4
(test-venv) $ pip install matplotlib
Collecting matplotlib
  Using cached matplotlib-3.7.1-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (7.5 MB)
Collecting contourpy>=1.0.1 (from matplotlib)
  Downloading contourpy-1.0.7-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (252 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 252.2/252.2 kB 6.2 MB/s eta 0:00:00
Collecting cycler>=0.10 (from matplotlib)
  Using cached cycler-0.11.0-py3-none-any.whl (6.4 kB)
Collecting fonttools>=4.22.0 (from matplotlib)
  Using cached fonttools-4.39.3-py3-none-any.whl (1.0 MB)
Collecting kiwisolver>=1.0.1 (from matplotlib)
  Downloading kiwisolver-1.4.4-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (79 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 79.4/79.4 kB 7.5 MB/s eta 0:00:00
Requirement already satisfied: numpy>=1.20 in ./test-venv/lib/pypy3.9/site-packages (from matplotlib) (1.22.4)
Collecting packaging>=20.0 (from matplotlib)
  Using cached packaging-23.1-py3-none-any.whl (48 kB)
Collecting pillow>=6.2.0 (from matplotlib)
  Using cached Pillow-9.5.0-pp39-pypy39_pp73-manylinux_2_28_x86_64.whl (3.3 MB)
Collecting pyparsing>=2.3.1 (from matplotlib)
  Using cached pyparsing-3.0.9-py3-none-any.whl (98 kB)
Collecting python-dateutil>=2.7 (from matplotlib)
  Using cached python_dateutil-2.8.2-py2.py3-none-any.whl (247 kB)
Collecting importlib-resources>=3.2.0 (from matplotlib)
  Using cached importlib_resources-5.12.0-py3-none-any.whl (36 kB)
Collecting zipp>=3.1.0 (from importlib-resources>=3.2.0->matplotlib)
  Using cached zipp-3.15.0-py3-none-any.whl (6.8 kB)
Collecting six>=1.5 (from python-dateutil>=2.7->matplotlib)
  Using cached six-1.16.0-py2.py3-none-any.whl (11 kB)
Installing collected packages: zipp, six, pyparsing, pillow, packaging, kiwisolver, fonttools, cycler, contourpy, python-dateutil, importlib-resources, matplotlib
Successfully installed contourpy-1.0.7 cycler-0.11.0 fonttools-4.39.3 importlib-resources-5.12.0 kiwisolver-1.4.4 matplotlib-3.7.1 packaging-23.1 pillow-9.5.0 pyparsing-3.0.9 python-dateutil-2.8.2 six-1.16.0 zipp-3.15.0
(test-venv) $ python -c 'from matplotlib._path import affine_transform'

Actual outcome

(test-venv) $ python -c 'from matplotlib._path import affine_transform'
RuntimeError: module compiled against API version 0x10 but this version of numpy is 0xf . Check the section C-API incompatibility at the Troubleshooting ImportError section at https://numpy.org/devdocs/user/troubleshooting-importerror.html#c-api-incompatibility for indications on how to solve this problem .
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/$USER/test-venv/lib/pypy3.9/site-packages/matplotlib/__init__.py", line 131, in <module>
    from . import _api, _version, cbook, _docstring, rcsetup
  File "/home/$USER/test-venv/lib/pypy3.9/site-packages/matplotlib/rcsetup.py", line 27, in <module>
    from matplotlib.colors import Colormap, is_color_like
  File "/home/$USER/test-venv/lib/pypy3.9/site-packages/matplotlib/colors.py", line 56, in <module>
    from matplotlib import _api, _cm, cbook, scale
  File "/home/$USER/test-venv/lib/pypy3.9/site-packages/matplotlib/scale.py", line 22, in <module>
    from matplotlib.ticker import (
  File "/home/$USER/test-venv/lib/pypy3.9/site-packages/matplotlib/ticker.py", line 138, in <module>
    from matplotlib import transforms as mtransforms
  File "/home/$USER/test-venv/lib/pypy3.9/site-packages/matplotlib/transforms.py", line 49, in <module>
    from matplotlib._path import (
ImportError: numpy.core.multiarray failed to import

Expected outcome

$ python -c 'from matplotlib._path import affine_transform'

Additional information

$ pip install matplotlib --no-build-isolation --no-binary matplotlib

works around the problem

Operating system

No response

Matplotlib Version

3.7.1

Matplotlib Backend

No response

Python version

No response

Jupyter version

No response

Installation

pip

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions