docling-project / docling-project/docling
ModuleNotFoundError: No module named 'docling_parse.pdf_parser' with docling 2.34.0 and docling-parse 4.0.1
- Dominant language
- Python
- Stars
- 66.4k
- Forks
- 4.8k
- Avg merge
- 2d 21h
- Merged PRs (30d)
- 84
Description
### Bug
When using the DocumentConverter from the docling library to parse a PDF, I encounter a ModuleNotFoundError: No module named 'docling_parse.pdf_parser'. This error occurs because the docling library attempts to import docling_parse.pdf_parser in docling_parse_v4_backend.py, but this module does not exist in the installed version of docling-parse (4.0.1). It seems that docling-parse 4.0.1 has renamed the module to docling_parse.pdfparser (without the underscore), causing a mismatch with what docling 2.34.0 expects.
Additionally, the dependency specification for docling 2.34.0 requires docling-parse>=4.0.0, <5.0.0, which is satisfied by 4.0.1, but the module structure change in docling-parse 4.0.0+ makes it incompatible with docling 2.34.0....
### Steps to reproduce
Create a virtual environment and activate it:
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
Install docling 2.34.0 and its dependencies:
pip install docling==2.34.0
This will automatically install docling-parse 4.0.1 as a dependency.
Create a Python script with the following code to parse a PDF:
from docling.document_converter import DocumentConverter, PdfFormatOption
from docling.datamodel.base_models import InputFormat
converter = DocumentConverter()
result = converter.convert("path/to/your/pdf/file.pdf")
Run the script:
python script.py
The script will fail with the following error:
Traceback (most recent call last):
File ".../docling/document_converter.py", line 15, in
from docling.backend.docling_parse_v4_backend import DoclingParseV4DocumentBackend
File ".../docling/backend/docling_parse_v4_backend.py", line 10, in
from docling_parse.pdf_parser import DoclingPdfParser, PdfDocument
ModuleNotFoundError: No module named 'docling_parse.pdf_parser'...
### Docling version
docling, version 2.34.0
...
### Python version
Python 3.13.2

...
Contributor guide
Assessment
This issue has not been assessed yet.