Repository navigation
Commit 67fe971
committed
Pin pyarrow<26 so ray.train imports with numpy 1.26
The Ubuntu 24.04 image (pytorch#3988) pins numpy==1.26.4, because numba 0.59.1
and spacy 3.7.2 need numpy < 2. pyarrow's wheels declare no numpy
requirement, so pip installs the latest pyarrow, 26.0.0, which fails at
import with "pyarrow requires NumPy 2.0 or newer, found 1.26.4".
ray.train reports any failure to import fsspec, pandas, pyarrow or
requests as "Can't import ray.train as some dependencies are missing",
so beginner_source/distributed_training_with_ray_tutorial.py failed the
Build tutorials job on main:
https://github.com/pytorch/tutorials/actions/runs/40763826746/job/123082673219
Cap pyarrow below 26. Drop the cap when numpy moves to 2.x.
Alternative considered: moving numpy to 2.x. That needs new numba and
spacy, which is a much larger change to the tutorial environment.
Test Plan:
In a Python 3.12 venv with numpy==1.26.4, ray[train]==2.55.0,
pandas==3.0.6, fsspec and requests:
```
python -c "import pyarrow" # 26.0.0: ImportError, NumPy 2.0 required
python -c "import pyarrow" # 22.0.0 to 25.0.0: ok
python -c "import ray.train" # with pyarrow<26: ok
```
The image has not been rebuilt: run the Docker Build workflow on this
PR, then the tutorial build, to verify.
This change was authored with an AI assistant (Claude Code).1 parent db4c5a1 commit 67fe971
1 file changed
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
24 | 27 | | |
25 | 28 | | |
26 | 29 | | |
| |||
0 commit comments