Install Docling on macOS
Apple Silicon (M1/M2/M3/M4) and Intel Macs with Python 3.10+. Verify each command against the official installation docs.
uname -m: arm64 is Apple Silicon, x86_64 is Intel.--device mps for GPU speed.torch 2.2.2 on Python ≤3.12.Which Mac do you have?
uname -marm64→ Apple Silicon. Follow sections 2–6. MPS acceleration is available.x86_64→ Intel. Follow sections 2–3, then section 7 before installing extras — newer torch wheels do not exist for Intel.
Python setup (both chips)
- Install Python 3.10–3.12 from python.org or
brew install python@3.12. - Always use a venv:
python3 --versionpython3 -m venv .venv && source .venv/bin/activatepython -m pip install -U pipBase install
pip install doclinguv alternative: uv add docling (or uv pip install docling inside the venv).
Apple Silicon + MPS acceleration
Apple Silicon runs Docling on PyTorch’s MPS (Metal) backend instead of CUDA. CPU is the default and works fine; select MPS when you want GPU speed:
docling convert report.pdf --device mpsdocling convert report.pdf --device autoCheck availability from Python:
python -c "import torch; print(torch.backends.mps.is_available())"If that prints False, update macOS + torch; some OCR engines are CPU-only regardless of this flag.
OcrMac: native Apple Vision OCR
macOS-only extra using the built-in Apple Vision framework — no Tesseract binary needed, private on-device OCR:
pip install "docling[ocrmac]"docling convert scan.pdf --ocr-engine ocrmac --ocr-mode full_pageUse it for English/European scans on modern macOS. For CJK or script-heavy scans, compare with RapidOCR/EasyOCR in the OCR guide.
Tesseract via Homebrew
Only needed for the Tesseract engines (tesserocr, CLI). Install the binary first:
brew install tesseract leptonica pkg-configpip install "docling[tesserocr]"TESSDATA_PREFIX=/opt/homebrew/share/tessdata/ docling convert scan.pdf --ocr-engine tesseractTESSDATA_PREFIX must end with a slash and point at the folder containing .traineddata files. On Intel Homebrew the prefix is usually /usr/local/share/tessdata/. Persist it with export TESSDATA_PREFIX=… in your shell profile.Intel Macs: the torch pin
Why: PyTorch 2.6.0+ publishes no wheels for Intel macOS, so a plain pip install docling can fail resolving torch. Two supported workarounds (Python ≤3.12 required):
uv add torch==2.2.2 torchvision==0.17.2 doclingpip install "docling[mac_intel]"If you already installed a broken torch, remove it first (pip uninstall torch torchvision) and reinstall with one of the lines above.
Verify
docling --helpdocling convert sample.pdf --to mdThen confirm your accelerator and OCR layers separately: --device mps on Apple Silicon, --ocr-engine ocrmac or rapidocr on a scanned page.
Common macOS problems
- torch fails on Intel — apply the section-7 pin; do not use Python 3.13+ on Intel.
TesseractNotFound/ missing languages — reinstall via Homebrew, setTESSDATA_PREFIX(trailing slash), see OCR package installation error.- OcrMac import error — the extra only works on macOS with a recent OS; reinstall
"docling[ocrmac]"inside the venv. - MPS not used — confirm
torch.backends.mps.is_available(); some stages fall back to CPU by design. - SSL / cert errors on first model download — update Python certs (
Install Certificates.commandfrom the python.org installer) and re-run.
macOS FAQ
M-series or Intel — does it matter?
--device mps and the OcrMac extra; Intel Macs must pin torch 2.2.2 and stay on Python ≤3.12. Everything else is identical.Should I use OcrMac or Tesseract?
TESSDATA_PREFIX. RapidOCR is a good pip-only middle ground.Do I need Xcode?
xcode-select --install.python vs python3?
python — always use python3 -m venv and activate before installing.Verified with Docling v2.129.0 · Last checked 2026-09-22 · Official source