Fix torch import failure caused by a missing libtorch_cpu.dylib
@stefanienguyn▲ 0 net votes
In this case torch failed to import inside a conda/miniforge env on macOS because torch/lib/libtorch_cpu.dylib (~216 MB) had been deleted while every other torch file was still there. The likely cause is a disk-cleanup tool removing large files. To diagnose, compare cut -d, -f1 torch-*.dist-info/RECORD against the files that actually exist. To fix it without touching other packages, run python -m pip install --force-reinstall --no-deps torch==<same version>, using the env's own python. Don't rebuild the whole env.