Skip to content

Installation Extras

The optional dependency matrix from natural_pdf.utils.optional_imports — the same data npdf doctor reports for your environment. Each extra is a pip install target; each row is one optional dependency the library probes for at runtime.

Install: pip install "natural-pdf[ai]"

DependencyPackagesWhat it enablesInstall on its own
rapidocrrapidocrDefault RapidOCR engine for OCR workflows.pip install "natural-pdf[all]" or pip install rapidocr
torchtorchPyTorch runtime used by QA/classification/layout engines.pip install "natural-pdf[all]" or pip install torch
torchvisiontorchvisionTorchVision models/utilities used by perception pipelines.pip install "natural-pdf[all]" or pip install torchvision
huggingface_hubhuggingface_hubModel hub utilities required by AI engines.pip install natural-pdf or pip install huggingface_hub
mlx_vlmmlx-vlmMLX local VLM runtime for Apple Silicon OCR and extraction. (Platform-conditional: npdf doctor shows N/A where it does not apply.)pip install "natural-pdf[ai]" or pip install mlx-vlm
transformerstransformersHugging Face transformers for QA/classification.pip install "natural-pdf[all]" or pip install transformers
sentence_transformerssentence-transformersEmbedding models for semantic search.pip install "natural-pdf[all]" or pip install sentence-transformers
timmtimmRequired backbone models for layout detectors.pip install "natural-pdf[all]" or pip install timm
doclayout_yolodoclayout_yoloYOLO-based layout detection models.pip install "natural-pdf[all]" or pip install doclayout_yolo

Install: pip install "natural-pdf[all]"

DependencyPackagesWhat it enablesInstall on its own
rapidocrrapidocrDefault RapidOCR engine for OCR workflows.pip install "natural-pdf[all]" or pip install rapidocr
torchtorchPyTorch runtime used by QA/classification/layout engines.pip install "natural-pdf[all]" or pip install torch
torchvisiontorchvisionTorchVision models/utilities used by perception pipelines.pip install "natural-pdf[all]" or pip install torchvision
huggingface_hubhuggingface_hubModel hub utilities required by AI engines.pip install natural-pdf or pip install huggingface_hub
mlx_vlmmlx-vlmMLX local VLM runtime for Apple Silicon OCR and extraction. (Platform-conditional: npdf doctor shows N/A where it does not apply.)pip install "natural-pdf[ai]" or pip install mlx-vlm
transformerstransformersHugging Face transformers for QA/classification.pip install "natural-pdf[all]" or pip install transformers
sentence_transformerssentence-transformersEmbedding models for semantic search.pip install "natural-pdf[all]" or pip install sentence-transformers
timmtimmRequired backbone models for layout detectors.pip install "natural-pdf[all]" or pip install timm
doclayout_yolodoclayout_yoloYOLO-based layout detection models.pip install "natural-pdf[all]" or pip install doclayout_yolo
pikepdfpikepdfRequired for creating searchable PDFs.pip install "natural-pdf[export]"
img2pdfimg2pdfImage to PDF conversion helper used by deskew/save routines.pip install "natural-pdf[export]"
openpyxlopenpyxlSpreadsheet writer used for Excel exports.pip install "natural-pdf[export]"
jupytextjupytextNotebook/text conversion support for export workflows.pip install "natural-pdf[export]"
nbformatnbformatNotebook format support for export workflows.pip install "natural-pdf[export]"
spellcheckerpyspellcheckerDictionary lookups for the to_llm garble-rate diagnostic.pip install "natural-pdf[all]" or pip install pyspellchecker
langdetectlangdetectLanguage detection for the to_llm garble-rate diagnostic.pip install "natural-pdf[all]" or pip install langdetect

Install: pip install "natural-pdf[export]"

DependencyPackagesWhat it enablesInstall on its own
pikepdfpikepdfRequired for creating searchable PDFs.pip install "natural-pdf[export]"
img2pdfimg2pdfImage to PDF conversion helper used by deskew/save routines.pip install "natural-pdf[export]"
openpyxlopenpyxlSpreadsheet writer used for Excel exports.pip install "natural-pdf[export]"
jupytextjupytextNotebook/text conversion support for export workflows.pip install "natural-pdf[export]"
nbformatnbformatNotebook format support for export workflows.pip install "natural-pdf[export]"

Install: pip install "natural-pdf[paddle]"

DependencyPackagesWhat it enablesInstall on its own
chardetchardetCharacter encoding detection dependency used by Paddle OCR tooling.pip install "natural-pdf[paddle]" or pip install chardet
paddlepaddlepaddlepaddlePaddlePaddle runtime for PaddleOCR.pip install "natural-pdf[paddle]" or pip install paddlepaddle
paddleocrpaddleocrPaddleOCR and PaddleOCR-VL engine stack.pip install "natural-pdf[paddle]" or pip install paddleocr
paddlexpaddlexPaddleX OCR pipeline dependency.pip install "natural-pdf[paddle]" or pip install paddlex[ocr]
numpynumpyNumeric runtime dependency; the Paddle extra pins this below 2.0.pip install "natural-pdf[paddle]" or pip install 'numpy<2.0'

Install: pip install "natural-pdf[quality]"

DependencyPackagesWhat it enablesInstall on its own
spellcheckerpyspellcheckerDictionary lookups for the to_llm garble-rate diagnostic.pip install "natural-pdf[all]" or pip install pyspellchecker
langdetectlangdetectLanguage detection for the to_llm garble-rate diagnostic.pip install "natural-pdf[all]" or pip install langdetect

These optional dependencies are opt-in: install them individually.

DependencyPackagesWhat it enablesInstall on its own
doctrpython-doctrOpt-in Doctr OCR engine.pip install python-doctr
easyocreasyocrOpt-in EasyOCR engine for OCR workflows.pip install easyocr
suryasurya-ocrOpt-in Surya OCR engine.pip install surya-ocr