Cannot build documentation (`RecursionError`)
- Dominant language
- Python
- Stars
- 103k
- Forks
- 29.6k
- PR merge metrics
- PR metrics pending
Description
### 📚 The doc issue
Anyone know what's going on? I'm pretty sure I've covered everything
```
git clone --filter=blob:none --no-checkout https://github.com/pytorch/pytorch/
git sparse-checkout init — cone
git sparse-checkout set docs aten test
git checkout main
cd docs
uv venv
source .venv/bin/activate
uv pip install -r requirements.txt
make latexpdf
```
I then get `ModuleNotFoundError: No module named 'torch'`, and after `uv pip install torch`
Logs
import torch
ModuleNotFoundError: No module named 'torch'
make: *** [Makefile:17: figures] Error 1
(docs) yalihupokn@zoqu-endiman:~/Repositories/dc/PT/pytorch/docs$
```
It outputs this line so many times I cannot scroll back to the `ModuleNotFoundErorr` in the terminal anymore:
```
File "/usr/lib64/python3.14/copy.py", line 138, in deepcopy
y = copier(memo)
File "/home/yalihupokn/Repositories/dc/PT/pytorch/docs/.venv/lib64/python3.14/site-packages/matplotlib/path.py", line 287, in __deepcopy__
p = copy.deepcopy(super(), memo)
File "/usr/lib64/python3.14/copy.py", line 157, in deepcopy
y = _reconstruct(x, memo, *rv)
File "/usr/lib64/python3.14/copy.py", line 234, in _reconstruct
y = func(*args)
File "/usr/lib64/python3.14/copy.py", line 233, in
args = (deepcopy(arg, memo) for arg in args)
~~~~~~~~^^^^^^^^^^^
RecursionError: maximum recursion depth exceeded
make: *** [Makefile:17: figures] Error 1
(docs) yalihupokn@zoqu-endiman:~/Repositories/dc/PT/pytorch/docs$
```
### Suggest a potential alternative/fix
Unfortunately using `python -m venv .venv` did not help either :/
cc @malfet @seemethere @svekars @sekyondaMeta @AlannaBurke
Contributor guide
Assessment
This issue has not been assessed yet.