Skip to content

Support python 3.12 #374

@brawer

Description

@brawer

Calamari can’t be installed on python 3.12. Here’s the error log from adding 3.12 to the test matrix in .github/workflows/python-test.yml. The problem is probably with an upstream dependency, but which one, and how to get it fixed?

  python -m pip install --upgrade pip
  pip install -e ".[test]"
  shell: /usr/bin/bash -e {0}
  env:
    pythonLocation: /opt/hostedtoolcache/Python/3.12.12/x64
    PKG_CONFIG_PATH: /opt/hostedtoolcache/Python/3.12.12/x64/lib/pkgconfig
    Python_ROOT_DIR: /opt/hostedtoolcache/Python/3.12.12/x64
    Python2_ROOT_DIR: /opt/hostedtoolcache/Python/3.12.12/x64
    Python3_ROOT_DIR: /opt/hostedtoolcache/Python/3.12.12/x64
    LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.12.12/x64/lib
Requirement already satisfied: pip in /opt/hostedtoolcache/Python/3.12.12/x64/lib/python3.12/site-packages (25.3)
Obtaining file:///home/runner/work/calamari/calamari
  Installing build dependencies: started
  Installing build dependencies: finished with status 'done'
  Checking if build backend supports build_editable: started
  Checking if build backend supports build_editable: finished with status 'done'
  Getting requirements to build editable: started
  Getting requirements to build editable: finished with status 'done'
  Preparing editable metadata (pyproject.toml): started
  Preparing editable metadata (pyproject.toml): finished with status 'done'
Collecting edit_distance (from calamari_ocr==0.1.dev1+gde5f95294)
  Downloading edit_distance-1.0.7-py3-none-any.whl.metadata (4.9 kB)
Collecting h5py (from calamari_ocr==0.1.dev1+gde5f95294)
  Downloading h5py-3.15.1-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.metadata (3.0 kB)
Collecting lxml (from calamari_ocr==0.1.dev1+gde5f95294)
  Downloading lxml-6.0.2-cp312-cp312-manylinux_2_26_x86_64.manylinux_2_28_x86_64.whl.metadata (3.6 kB)
Collecting python-bidi~=0.4.2 (from calamari_ocr==0.1.dev1+gde5f95294)
  Downloading python_bidi-0.4.2-py2.py3-none-any.whl.metadata (4.6 kB)
Collecting tensorflow>=2.4.0 (from calamari_ocr==0.1.dev1+gde5f95294)
  Downloading tensorflow-2.20.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (4.5 kB)
Collecting ocrd-fork-tfaip>=1.2.7 (from calamari_ocr==0.1.dev1+gde5f95294)
  Downloading ocrd_fork_tfaip-1.2.7-py3-none-any.whl.metadata (9.4 kB)
Collecting xlsxwriter (from calamari_ocr==0.1.dev1+gde5f95294)
  Downloading xlsxwriter-3.2.9-py3-none-any.whl.metadata (2.7 kB)
Collecting pytest (from calamari_ocr==0.1.dev1+gde5f95294)
  Downloading pytest-9.0.2-py3-none-any.whl.metadata (7.6 kB)
Collecting pytest-cov (from calamari_ocr==0.1.dev1+gde5f95294)
  Downloading pytest_cov-7.0.0-py3-none-any.whl.metadata (31 kB)
Collecting pytest-isolate (from calamari_ocr==0.1.dev1+gde5f95294)
  Downloading pytest_isolate-0.0.13-py3-none-any.whl.metadata (5.6 kB)
Collecting pytest-xdist (from calamari_ocr==0.1.dev1+gde5f95294)
  Downloading pytest_xdist-3.8.0-py3-none-any.whl.metadata (3.0 kB)
Collecting flake8 (from calamari_ocr==0.1.dev1+gde5f95294)
  Downloading flake8-7.3.0-py2.py3-none-any.whl.metadata (3.8 kB)
Collecting six (from python-bidi~=0.4.2->calamari_ocr==0.1.dev1+gde5f95294)
  Downloading six-1.17.0-py2.py3-none-any.whl.metadata (1.7 kB)
Collecting ocrd-fork-adabelief-tf (from ocrd-fork-tfaip>=1.2.7->calamari_ocr==0.1.dev1+gde5f95294)
  Downloading ocrd_fork_adabelief_tf-0.2.1-py3-none-any.whl.metadata (968 bytes)
Collecting dataclasses-json (from ocrd-fork-tfaip>=1.2.7->calamari_ocr==0.1.dev1+gde5f95294)
  Downloading dataclasses_json-0.6.7-py3-none-any.whl.metadata (25 kB)
Collecting GitPython (from ocrd-fork-tfaip>=1.2.7->calamari_ocr==0.1.dev1+gde5f95294)
  Downloading gitpython-3.1.45-py3-none-any.whl.metadata (13 kB)
Collecting imageio (from ocrd-fork-tfaip>=1.2.7->calamari_ocr==0.1.dev1+gde5f95294)
  Downloading imageio-2.37.2-py3-none-any.whl.metadata (9.7 kB)
Collecting nptyping (from ocrd-fork-tfaip>=1.2.7->calamari_ocr==0.1.dev1+gde5f95294)
  Downloading nptyping-2.5.0-py3-none-any.whl.metadata (7.6 kB)
Collecting opencv-python-headless (from ocrd-fork-tfaip>=1.2.7->calamari_ocr==0.1.dev1+gde5f95294)
  Downloading opencv_python_headless-4.12.0.88-cp37-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.metadata (19 kB)
Collecting openpyxl (from ocrd-fork-tfaip>=1.2.7->calamari_ocr==0.1.dev1+gde5f95294)
  Downloading openpyxl-3.1.5-py2.py3-none-any.whl.metadata (2.5 kB)
Collecting paiargparse==1.1.2 (from ocrd-fork-tfaip>=1.2.7->calamari_ocr==0.1.dev1+gde5f95294)
  Downloading paiargparse-1.1.2-py3-none-any.whl.metadata (10 kB)
Collecting pandas (from ocrd-fork-tfaip>=1.2.7->calamari_ocr==0.1.dev1+gde5f95294)
  Downloading pandas-2.3.3-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.metadata (91 kB)
Collecting pillow (from ocrd-fork-tfaip>=1.2.7->calamari_ocr==0.1.dev1+gde5f95294)
  Downloading pillow-12.0.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.metadata (8.8 kB)
Collecting prettytable (from ocrd-fork-tfaip>=1.2.7->calamari_ocr==0.1.dev1+gde5f95294)
  Downloading prettytable-3.17.0-py3-none-any.whl.metadata (34 kB)
Collecting python-Levenshtein (from ocrd-fork-tfaip>=1.2.7->calamari_ocr==0.1.dev1+gde5f95294)
  Downloading python_levenshtein-0.27.3-py3-none-any.whl.metadata (3.9 kB)
Collecting scikit-image (from ocrd-fork-tfaip>=1.2.7->calamari_ocr==0.1.dev1+gde5f95294)
  Downloading scikit_image-0.26.0-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.metadata (15 kB)
Collecting pooch==1.4.0 (from ocrd-fork-tfaip>=1.2.7->calamari_ocr==0.1.dev1+gde5f95294)
  Downloading pooch-1.4.0-py3-none-any.whl.metadata (10 kB)
INFO: pip is looking at multiple versions of ocrd-fork-tfaip to determine which version is compatible with other requirements. This could take a while.
ERROR: Cannot install None, calamari-ocr[test]==0.1.dev1+gde5f95294 and calamari_ocr because these package versions have conflicting dependencies.

The conflict is caused by:
    calamari-ocr 0.1.dev1+gde5f95294 depends on tensorflow>=2.4.0
    calamari-ocr[test] 0.1.dev1+gde5f95294 depends on tensorflow>=2.4.0
    ocrd-fork-tfaip 1.2.7 depends on tensorflow<2.16.0 and >=2.4.0

Additionally, some packages in these conflicts have no matching distributions available for your environment:
    tensorflow

To fix this you could try to:
1. loosen the range of package versions you've specified
2. remove package versions to allow pip to attempt to solve the dependency conflict

ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/topics/dependency-resolution/#dealing-with-dependency-conflicts
Error: Process completed with exit code 1.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions