colesbury / nogil

Multithreaded Python without the GIL
Other
2.91k stars 107 forks source link

Error when doing `pip install matplotlib` because of of contourpy 1.1 release (more generally for projects that depend on meson or pybind>=2.10.4) #116

Closed lesteve closed 7 months ago

lesteve commented 1 year ago
docker run -it nogil/python bash -c 'pip install matplotlib'

contourpy needs meson that wants pybind>=2.10.4 which is not available for nogil. This can happen in other projects that depends on meson.

The easy work-around is to do pip install matplotlib 'contourpy<1.1'. I created an issue since it took me a bit of time to get to the root cause of the issue. This is probably not super high priority for the nogil effort.

Full error:

Looking in indexes: https://d1yxz45j0ypngg.cloudfront.net/, https://pypi.org/simple
Collecting matplotlib
  Downloading https://d1yxz45j0ypngg.cloudfront.net/matplotlib-3.6.2-nogil39-nogil_39b_x86_64_linux_gnu-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (12.0 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 12.0/12.0 MB 80.5 MB/s eta 0:00:00
Collecting packaging>=20.0
  Downloading packaging-23.1-py3-none-any.whl (48 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 48.9/48.9 kB 2.2 MB/s eta 0:00:00
Collecting python-dateutil>=2.7
  Downloading python_dateutil-2.8.2-py2.py3-none-any.whl (247 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 247.7/247.7 kB 8.9 MB/s eta 0:00:00
Collecting contourpy>=1.0.1
  Downloading contourpy-1.1.0.tar.gz (13.4 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 13.4/13.4 MB 89.1 MB/s eta 0:00:00
  Installing build dependencies ... error
  error: subprocess-exited-with-error

  × pip subprocess to install build dependencies did not run successfully.
  │ exit code: 1
  ╰─> [9 lines of output]
      Looking in indexes: https://d1yxz45j0ypngg.cloudfront.net/, https://d1yxz45j0ypngg.cloudfront.net/, https://pypi.org/simple
      Collecting meson[ninja]>=1.1.0
        Downloading meson-1.2.0-py3-none-any.whl (962 kB)
           ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 962.4/962.4 kB 13.3 MB/s eta 0:00:00
      Collecting meson-python>=0.13.1
        Downloading meson_python-0.13.2-py3-none-any.whl (79 kB)
           ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 79.5/79.5 kB 31.8 MB/s eta 0:00:00
      ERROR: Could not find a version that satisfies the requirement pybind11>=2.10.4 (from versions: 2.6.2)
      ERROR: No matching distribution found for pybind11>=2.10.4
      [end of output]

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

× pip subprocess to install build dependencies did not run successfully.
│ exit code: 1
╰─> See above for output.

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

I bumped into this in the context of the scikit-learn CI.

bridgesign commented 1 year ago

Hi @lesteve,

As a quick hack, I cloned contourpy and changed the pybind requirements to version 2.6.2. It is just a workaround, but I get most of the functionality. Until the issue is resolved, this can be used. Another trick was to manually install an older version of contourpy using pip and then install matplotlib.

lesteve commented 7 months ago

Looks like there is a contourpy 1.1.1 wheel now, so this problem does not happen anymore.