Troubleshooting Guide¶
This guide covers common issues you might encounter during the workshop and their solutions.
Installation Issues¶
Python Version Errors¶
Problem: Assertion error about Python version
AssertionError: Use Python 3.10, 3.11, 3.12, or 3.13 to run this notebook.
Solution:
-
Check your Python version:
python3 --version -
If using an older version, install a supported version:
- macOS:
brew install python@3.12 - Ubuntu:
sudo apt install python3.12 - Windows: Download from python.org
- macOS:
-
Create a new virtual environment with the correct version:
python3.12 -m venv venv source venv/bin/activate
Dependency Installation Failures¶
Problem: pip install fails with compilation errors
Solution:
-
Ensure you have build tools installed:
- macOS:
xcode-select --install - Ubuntu:
sudo apt install build-essential - Windows: Install Visual Studio Build Tools
- macOS:
-
Try using
uvfor faster, more reliable installs:pip install uv uv pip install docling
Memory Errors During Installation¶
Problem: Installation runs out of memory
Solution:
- Close other applications to free memory
- Install packages one at a time instead of all at once
-
Use
--no-cache-dirflag:pip install --no-cache-dir docling
Model Loading Issues¶
VLM Models Won't Load¶
Problem: Error loading SmolDocling or Granite Vision models
Solution:
- Check available memory - VLM models require 4-8 GB RAM
- Try a smaller model first
-
For Apple Silicon, ensure MLX backend is used:
from docling.datamodel.pipeline_options import smoldocling_vlm_mlx_conversion_options
Ollama/LM Studio Connection Errors¶
Problem: Cannot connect to local model server
Solution:
-
Verify the server is running:
curl http://localhost:11434/api/tags # Ollama curl http://localhost:1234/v1/models # LM Studio -
Check the port is correct in your code
- Ensure no firewall is blocking localhost connections
Document Processing Issues¶
PDF Conversion Fails¶
Problem: Error converting certain PDFs
Solution:
-
Try enabling OCR for scanned documents:
PdfPipelineOptions(do_ocr=True) -
Check if the PDF is password-protected
- Try converting a simpler PDF first to verify setup
Out of Memory During Conversion¶
Problem: Kernel dies or out of memory error
Solution:
- Process fewer pages at a time
-
Reduce image resolution:
PdfPipelineOptions(images_scale=1.0) # Instead of 2.0 -
Disable features you don't need:
PdfPipelineOptions( generate_page_images=False, generate_picture_images=False, )
Slow Document Processing¶
Problem: Conversion takes too long
Solution:
- Disable OCR if not needed (
do_ocr=False) - Reduce image quality for faster processing
- Use a GPU if available
-
For large documents, save JSON output and reuse:
doc.save_as_json("document.json") # Later: doc = DoclingDocument.load_from_json("document.json")
Replicate API Issues¶
Rate Limiting¶
Problem: "Too many requests" error from Replicate
Solution:
- Add delays between requests
- Use local inference instead (LM Studio or Ollama)
- Contact Replicate for higher rate limits
API Token Issues¶
Problem: Authentication errors
Solution:
-
Verify your token is set:
echo $REPLICATE_API_TOKEN -
Regenerate your token at replicate.com/account/api-tokens
-
For Colab, check the Secrets tab has the correct value
Vector Database Issues¶
Milvus Lite Errors¶
Problem: Database connection or storage errors
Solution:
-
Use a fresh database file:
import tempfile db_file = tempfile.NamedTemporaryFile(suffix=".db", delete=False).name -
Ensure you have write permissions to the directory
- Check disk space is available
Jupyter Notebook Issues¶
Kernel Dies Unexpectedly¶
Problem: Jupyter kernel crashes during execution
Solution:
- Check system memory usage
- Run memory-intensive cells one at a time
- Restart the kernel and run cells in order
- Consider using Google Colab for more resources
Widgets Not Displaying¶
Problem: ipywidgets not showing in notebook
Solution:
-
Install the widget extension:
pip install ipywidgets jupyter nbextension enable --py widgetsnbextension -
Restart Jupyter after installation
Getting Help¶
If you encounter an issue not covered here:
- Check the Docling GitHub Issues
- Search the Docling Discussions
- Open a new issue with:
- Your Python version
- Your operating system
- The complete error message
- Steps to reproduce the issue