Install Docling
The complete, verified path from zero to your first conversion โ Python setup, pip vs uv, virtual environments, every optional extra, PyTorch CPU / CUDA / MPS builds, Tesseract system packages, model downloads, verification and per-OS fixes. Works on macOS, Linux and Windows (x86_64 and arm64).
Which install path should you choose?
| Your situation | Start here | Why |
|---|---|---|
| Just want to convert PDFs locally | pip install docling | Core package; no Docker, no server needed. |
| On Windows and hitting compiler errors | Windows guide + uv add docling | uv resolves pre-built wheels and skips MSVC. |
| Need an HTTP API for an app | Docker / docling-serve guide | Official container exposes /v1/convert/source, /docs, /ui. |
| Need GPU speed on Linux | Linux guide | CUDA-enabled torch + --device cuda. |
| On a Mac | macOS guide | Apple Silicon uses MPS; Intel needs pinned torch. |
| Scanned PDFs / OCR | Extras table + OCR guide | Pick RapidOCR, EasyOCR, Tesseract or OcrMac. |
Requirements (all platforms)
- Python 3.10 or newer, 64-bit. Python 3.9 support was dropped in Docling 2.70.0. Very new Python releases may lag until Docling adds wheels โ check the PyPI release history if your version has no wheel.
- pip 23+ or Astral uv. uv is faster and avoids most Windows compiler issues.
- ~2โ4 GB free disk for models on first run (layout, table structure, OCR models).
- Working internet on first run so models can download (see model cache for offline machines).
- Optional: Tesseract system binary (only if you choose a Tesseract engine), CUDA drivers (only for NVIDIA GPU), Docker (only for docling-serve).
python --version && pip --versionCreate an isolated environment (recommended)
Docling pulls in PyTorch, ONNX and OCR libraries. Never install it into your system Python โ one conflicting torch or numpy can break other tools. Pick one:
Option A โ venv + pip (everywhere)
python -m venv .venvsource .venv/bin/activateOption B โ uv (fastest, best on Windows)
uv venv --python 3.12uv add docling.venv\Scripts\Activate.ps1 instead of the source line.Quick install: pip vs uv
Standard (pip):
pip install doclingWith uv (resolves pre-compiled wheels, avoids C++ build tools):
uv add doclingBoth install the same package from PyPI on macOS, Linux and Windows (x86_64 + arm64). For the full official instructions see the official installation docs.
Every optional extra, explained
The base package covers default conversion. Anything needing heavy third-party deps ships as an extra, installed with pip install "docling[NAME]" (combine with commas: "docling[rapidocr,vlm]").
| Extra | What it adds | Install |
|---|---|---|
| rapidocr | RapidOCR engine (ONNX Runtime backend) โ easiest cross-platform OCR | pip install "docling[rapidocr]" |
| easyocr | EasyOCR engine โ pure-Python install, good multilingual coverage | pip install "docling[easyocr]" |
| tesserocr | Fast Tesseract binding (needs system Tesseract first, see below) | pip install "docling[tesserocr]" |
| ocrmac | Apple Vision OCR โ macOS only | pip install "docling[ocrmac]" |
| vlm | Vision-language-model pipeline deps (Granite Docling etc.) | pip install "docling[vlm]" |
| asr | Audio-speech-recognition pipeline (Whisper) | pip install "docling[asr]" |
| htmlrender | HTML page rendering for the HTML backend | pip install "docling[htmlrender]" |
| feat-ocr-nemotron | NVIDIA Nemotron OCR โ Linux x86_64 + Python 3.12 + CUDA 13.x only | pip install "docling[feat-ocr-nemotron]" --extra-index-url https://download.pytorch.org/whl/cu130 --index-strategy unsafe-best-match |
| mac_intel | Pinned torch compatible with Intel Macs (PyTorch โฅ2.6 drops Intel wheels) | pip install "docling[mac_intel]" |
PyTorch builds: CPU-only, CUDA, MPS, Intel Macs
Docling models run on PyTorch. The default wheel works for most people, but three cases need a special build:
- Linux CPU-only servers: avoid the large CUDA wheel and install the small CPU build:
uv users pin torch to the CPU index inpip install docling --extra-index-url https://download.pytorch.org/whl/cpupyproject.toml(see the Linux guide for the exact snippet). - NVIDIA GPU on Linux/Windows: install a CUDA-enabled torch for your CUDA version, then select it with
--device cuda. WSL2 is the simplest CUDA path on Windows โ full steps in the Windows guide. - macOS Intel (x86_64): PyTorch 2.6.0+ ships no Intel wheels. Pin the last good build and stay on Python โค3.12:
or
uv add torch==2.2.2 torchvision==0.17.2 doclingpip install "docling[mac_intel]" - Apple Silicon: works out of the box; select the MPS backend with
--device mpswhen needed (see the macOS guide).
Tesseract system packages + TESSDATA_PREFIX
Only needed if you pick a Tesseract engine. Install the binary with your OS package manager before the pip extra, then point TESSDATA_PREFIX at the language data (note the trailing slash):
| OS | Install | TESSDATA_PREFIX example |
|---|---|---|
| macOS (Homebrew) | brew install tesseract leptonica pkg-config | /opt/homebrew/share/tessdata/ |
| Ubuntu / Debian | sudo apt-get install tesseract-ocr tesseract-ocr-eng libtesseract-dev libleptonica-dev pkg-config | from dpkg -L tesseract-ocr-eng | grep tessdata$ |
| RHEL / Fedora | sudo dnf install tesseract tesseract-devel tesseract-langpack-eng tesseract-osd leptonica-devel | /usr/share/tesseract/tessdata/ |
| Windows | Install UB Mannheim build, add to PATH | set TESSDATA_PREFIX to its tessdata\ folder |
tesserocr fails to build, try pip uninstall tesserocr then pip install --no-binary :all: tesserocr.Verify your installation
Run these three checks in order โ each one isolates a different failure layer:
docling --helppython -c "import docling; print(docling.__version__)"docling convert sample.pdf --to md--to json, --to html, and --ocr-engine rapidocr to confirm each layer. If any step fails, match the error in section 11 or the troubleshooting reference.First run downloads models โ plan for it
- The first conversion downloads layout, table-structure and OCR models โ expect it to be slow once, then fast.
- Keep a stable connection for that first run; a partial download leaves a broken cache โ just re-run.
- Pre-download everything ahead of time with
docling-tools models download --all - Point the cache at a writable disk with
DOCLING_CACHE_DIRif the default location is read-only or too small. - Air-gapped machines: download on a connected host, then copy the cache directory over.
Upgrade, pin and uninstall
pip install -U doclingpip install "docling==2.129.0"pip uninstall doclingrequirements.txt, lockfile or container tag) so a model or CLI change cannot surprise you. This site is verified against the version in the badge below.Fix the 5 most common install failures
Microsoft Visual C++ 14.0 is required(Windows): switch touv add doclingfor pre-built wheels, or install Build Tools viawinget install Microsoft.VisualStudio.2022.BuildToolswith the C++ workload. Details in the Windows guide and troubleshooting.- Python version errors: create a fresh env with 3.10โ3.12 (
uv venv --python 3.12). Python 3.9 is unsupported since 2.70.0. - OCR extra fails: use
rapidocroreasyocr(pip-only); for Tesseract install the system binary +TESSDATA_PREFIXfirst. - GPU ignored (runs on CPU): confirm
torch.cuda.is_available()is True, install a CUDA torch, pass--device cuda(MPS on Apple Silicon). - Out of memory / very slow: convert one file at a time, lower
--num-threads, add--no-ocrfor digital PDFs.
Installation FAQ
What Python version does Docling need?
pip or uv โ which should I use?
uv add docling if you already use uv; otherwise pip install docling is fine.Do I need Docker?
docling-serve, the HTTP API server, as a container. See the Docker guide.Do I need a GPU?
Why is the first conversion so slow?
docling-tools models download --all. Later runs reuse the cache.Which OCR engine installs most easily?
docling[rapidocr]) or EasyOCR (docling[easyocr]) โ both are pip-only. Tesseract is excellent but needs a system binary plus language data; OcrMac only works on macOS.Can I install Docling offline?
DOCLING_CACHE_DIR to the copied cache on the offline host.Verified with Docling v2.129.0 · Last checked 2026-09-22 · Official source