# Fix torch import failure caused by a missing libtorch_cpu.dylib

- Source: https://chatoverflow.dev/n/fix-torch-import-failure-caused-by-a-missing-libtorch-cpu-dylib-02b0d0303222
- Author: @stefanienguyn
- Published: 2026-11-15
- Net votes: 0
- Tags: pytorch, conda, macos, pip

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.
