Python 3.13 support
In this issue we keep track of the Python 3.13 support in Docling and its components. In most cases, we have to wait for stating a complete support, until the main dependencies will be distributed for 3.13 as well.
Docling components
🟢 The package is available and fully working 🟠 The package relies on dependencies which are not available on Python 3.13 🔴 The package is not working or available for Python 3.13
| Package | Status | PR |
|---|---|---|
| Docling | 🟠 | |
| Docling Core | 🟢 | |
| Docling IBM Models | 🟠 (torch) |
|
| Docling Parse | 🟢 | ~https://github.com/DS4SD/docling-parse/pull/39~ |
| DeepSearch GLM | 🟢 | ~https://github.com/DS4SD/deepsearch-glm/pull/82~ |
Dependencies
| Package | Status | Details |
|---|---|---|
| Torch | 🔴 | Nightly builds working |
Workaround
Full support for Python 3.13 is currently waiting for pytorch.
At the moment, no release has full support, but nightly builds are available. Docling was tested on Python 3.13 with the following steps:
# Create a python 3.13 virtualenv
python3.13 -m venv venv
source ./venv/bin/activate
# Install torch nightly builds, see https://pytorch.org/
pip3 install --pre torch torchvisio --index-url https://download.pytorch.org/whl/nightly/cpu
# Install docling
pip3 install docling
# Run docling
docling --no-ocr https://arxiv.org/pdf/2408.09869
Note: we are disabling OCR since easyocr and the nightly torch builds have some conflicts.
Cc @cau-git @vagenas @PeterStaar-IBM
@dolfim-ibm I think we need to follow this PR: https://github.com/pytorch/pytorch/issues/130249 for docling-ibm-models
any updates on this?
any updates on this?
we are waiting for torch to support python 3.13. They started with linux x86, but all other platforms and arch are missing.
Seems that nightlies are working on OSX now with Python 3.13, however Docling is requiring <2.5.0 and the expected fix will be delivered in 2.5.1, can we consider extending the upper version range by a major or even removing it?
Seems that nightlies are working on OSX now with Python 3.13, however Docling is requiring <2.5.0 and the expected fix will be delivered in 2.5.1, can we consider extending the upper version range by a major or even removing it?
Great, thanks for checking that!
Where do you see the <2.5.0 dependency? It should be something more flexible like >=2.2.2,<3.0.0.
$ poetry show torch
required by
- docling-ibm-models >=2.2.2,<3.0.0
- easyocr *
- sentence-transformers >=1.11.0
You are right, actually after installing nightly successfully on 3.13 I'm faced with yet another conflict when trying to install Docling:
ERROR: Cannot install docling==1.10.0, docling==1.11.0, docling==1.12.0, docling==1.12.1, docling==1.12.2, docling==1.13.0, docling==1.13.1, docling==1.14.0, docling==1.15.0, docling==1.16.0, docling==1.16.1, docling==1.17.0, docling==1.18.0, docling==1.19.0, docling==1.19.1, docling==1.2.0, docling==1.2.1, docling==1.20.0, docling==1.3.0, docling==1.4.0, docling==1.5.0, docling==1.6.0, docling==1.6.1, docling==1.6.2, docling==1.6.3, docling==1.8.5, docling==1.9.0, docling==2.0.0, docling==2.1.0, docling==2.2.0, docling==2.2.1 and docling==2.3.0 because these package versions have conflicting dependencies.
The conflict is caused by:
docling 2.3.0 depends on torchvision<1 and >=0; sys_platform != "darwin" or platform_machine != "x86_64"
docling 2.2.1 depends on torchvision<1 and >=0; sys_platform != "darwin" or platform_machine != "x86_64"
docling 2.2.0 depends on torchvision<1 and >=0; sys_platform != "darwin" or platform_machine != "x86_64"
docling 2.1.0 depends on torchvision<1 and >=0; sys_platform != "darwin" or platform_machine != "x86_64"
docling 2.0.0 depends on torchvision<1 and >=0; sys_platform != "darwin" or platform_machine != "x86_64"
docling 1.20.0 depends on deepsearch-glm<0.23.0 and >=0.22.0
docling 1.19.1 depends on deepsearch-glm<0.23.0 and >=0.22.0
docling 1.19.0 depends on deepsearch-glm<0.23.0 and >=0.22.0
docling 1.18.0 depends on deepsearch-glm<0.23.0 and >=0.22.0
docling 1.17.0 depends on deepsearch-glm<0.23.0 and >=0.22.0
docling 1.16.1 depends on deepsearch-glm<0.22.0 and >=0.21.1
docling 1.16.0 depends on deepsearch-glm<0.22.0 and >=0.21.1
docling 1.15.0 depends on deepsearch-glm<0.22.0 and >=0.21.1
docling 1.14.0 depends on deepsearch-glm<0.22.0 and >=0.21.1
docling 1.13.1 depends on deepsearch-glm<0.22.0 and >=0.21.1
docling 1.13.0 depends on deepsearch-glm<0.22.0 and >=0.21.1
docling 1.12.2 depends on deepsearch-glm<0.22.0 and >=0.21.0
docling 1.12.1 depends on deepsearch-glm<0.22.0 and >=0.21.0
docling 1.12.0 depends on deepsearch-glm<0.22.0 and >=0.21.0
docling 1.11.0 depends on deepsearch-glm<0.22.0 and >=0.21.0
docling 1.10.0 depends on deepsearch-glm<0.22.0 and >=0.21.0
docling 1.9.0 depends on deepsearch-glm<0.20.0 and >=0.19.1
docling 1.8.5 depends on deepsearch-glm<0.20.0 and >=0.19.1
docling 1.6.3 depends on docling-parse<0.3.0 and >=0.2.0
docling 1.6.2 depends on docling-parse<0.3.0 and >=0.2.0
docling 1.6.1 depends on docling-parse<0.3.0 and >=0.2.0
docling 1.6.0 depends on docling-parse<0.3.0 and >=0.2.0
docling 1.5.0 depends on docling-parse<0.3.0 and >=0.2.0
docling 1.4.0 depends on docling-parse<0.3.0 and >=0.2.0
docling 1.3.0 depends on docling-parse<0.0.2 and >=0.0.1
docling 1.2.1 depends on docling-parse<0.0.2 and >=0.0.1
docling 1.2.0 depends on docling-parse<0.0.2 and >=0.0.1
It looks like untangling this one is not easy as trying to manually install these I run into various other issues with deepsearch-glm (torchvision installs fine).
Any ideas what is going on or a workaround would be much appreciated.
Interesting. Something we should double check are all the numpy requirements, because python3.13 is supported only by numpt >=2.1.0. I think we aligned all of them already, but maybe some were forgotten. We will try to reproduce the nightly installation as well.
@w0o we found some small conflict but we fixed them in v2.8.1. The description of this issue was also updated with guidelines for using pytorch nightly builds.
Nicely done 🎉
Worked like charm and I was able to run it on 3.13 (OSX) but just a quick note, I couldn't help noticing that torchaudio was included and I tested and found out it installs and works fine without it so maybe consider removing it (unless there is some use-case of Docling which requires it).
pip3 install --pre torch torchvision --index-url https://download.pytorch.org/whl/nightly/cpu
Props for the swift update!
@dolfim-ibm the description of this issue contains a typo, which results in error on installing pytorch-nightly
ERROR: Could not find a version that satisfies the requirement torchvisio (from versions: none)
ERROR: No matching distribution found for torchvisio
- pip3 install --pre torch torchvisio --index-url https://download.pytorch.org/whl/nightly/cpu
+ pip3 install --pre torch torchvision --index-url https://download.pytorch.org/whl/nightly/cpu
Any update on getting this to work out of the box, or is this waiting for a torch release for PyPi?
Doing $ pip3 install --pre torch torchvision --index-url https://download.pytorch.org/whl/nightly/cpu Followed by:
$ pip install docling
Works for me on Fedora 41, but we want to get to the point where this works automatically in the RamaLama project.
@knumskull thanks, the post has been updated.