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.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 Granite-Docling or Granite Vision models
Solution:
- Check available memory - VLM models require 4-8 GB RAM
- Try a smaller model first
-
On Apple Silicon, the
granite_doclingpreset uses the MLX build automatically. Make sure MLX is installed withdocling[vlm]:from docling.datamodel.pipeline_options import VlmConvertOptions, VlmPipelineOptions vlm_pipeline_options = VlmPipelineOptions( vlm_options=VlmConvertOptions.from_preset("granite_docling"), )
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")
Docling Service Issues¶
Notebook Still Converts Locally¶
Problem: The notebook prints Docling conversions will run locally although you set up a Docling service
Solution:
- Check the variable name is exactly
DOCLING_SERVICE_URL - If you exported it in a terminal, restart Jupyter from that terminal so the kernel sees it
- For Colab, check the Secrets tab has the value and notebook access is enabled
Authentication Errors¶
Problem: ServiceError with status=401
Solution: Check DOCLING_SERVICE_API_KEY holds the API key for the service at DOCLING_SERVICE_URL
Conversion Timeouts¶
Problem: TaskTimeoutError for large documents or picture descriptions
Solution: Give the client more time, for example DoclingServiceClient(url=..., api_key=..., job_timeout=1800)
Usage Limits¶
Problem: UsageLimitExceededError
Solution: Your service plan or trial has reached its page limit. Check your plan, or unset DOCLING_SERVICE_URL to run Docling locally.
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¶
Duplicate or Stale Results from ChromaDB¶
Problem: Retrieval returns chunks from an earlier run, or the same chunk twice
Solution:
- The RAG notebooks keep ChromaDB in memory, so restart the kernel and run the cells in order
- After switching the embeddings model, rebuild the vector database: embeddings from different models can't be mixed
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 ipywidgets in the same environment as Jupyter:
pip install ipywidgets -
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