facebookresearch / nougat

Implementation of Nougat Neural Optical Understanding for Academic Documents
https://facebookresearch.github.io/nougat/
MIT License
8.98k stars 567 forks source link

ERROR: Cannot install nougat-ocr because these package versions have conflicting dependencies. #104

Closed tiansiyuan closed 1 year ago

tiansiyuan commented 1 year ago

When I run:

pip install "nougat-ocr[api]"

I get this error.

The complete message is:

Collecting nougat-ocr[api] Obtaining dependency information for nougat-ocr[api] from https://files.pythonhosted.org/packages/1f/25/98a82e856df6c187b65864860a30fc833227e9b1e86ca917f05061fb472c/nougat_ocr-0.1.11-py3-none-any.whl.metadata Using cached nougat_ocr-0.1.11-py3-none-any.whl.metadata (9.9 kB) Requirement already satisfied: transformers>=4.25.1 in /opt/conda/lib/python3.9/site-packages (from nougat-ocr[api]) (4.31.0) Collecting timm==0.5.4 (from nougat-ocr[api]) Using cached timm-0.5.4-py3-none-any.whl (431 kB) Collecting orjson (from nougat-ocr[api]) Obtaining dependency information for orjson from https://files.pythonhosted.org/packages/0e/31/49db18d0728852eea1f633e92cf189acf819508da9ff1b30c99baf401c85/orjson-3.9.7-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata Using cached orjson-3.9.7-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (49 kB) Requirement already satisfied: opencv-python-headless in /opt/conda/lib/python3.9/site-packages (from nougat-ocr[api]) (4.8.0.74) Collecting datasets[vision] (from nougat-ocr[api]) Obtaining dependency information for datasets[vision] from https://files.pythonhosted.org/packages/09/7e/fd4d6441a541dba61d0acb3c1fd5df53214c2e9033854e837a99dd9e0793/datasets-2.14.5-py3-none-any.whl.metadata Using cached datasets-2.14.5-py3-none-any.whl.metadata (19 kB) Collecting lightning>=2.0.0 (from nougat-ocr[api]) Obtaining dependency information for lightning>=2.0.0 from https://files.pythonhosted.org/packages/2f/90/2a2bc44409df179e3959209c2b16b4dab438a116fdd0b52470a0e2f1f0be/lightning-2.0.9-py3-none-any.whl.metadata Using cached lightning-2.0.9-py3-none-any.whl.metadata (41 kB) Collecting nltk (from nougat-ocr[api]) Using cached nltk-3.8.1-py3-none-any.whl (1.5 MB) Collecting python-Levenshtein (from nougat-ocr[api]) Obtaining dependency information for python-Levenshtein from https://files.pythonhosted.org/packages/ae/9c/208f8ad7eb38492ac4f829790a500bcfca88b1d0a1c988f6480a52a6f681/python_Levenshtein-0.21.1-py3-none-any.whl.metadata Using cached python_Levenshtein-0.21.1-py3-none-any.whl.metadata (3.8 kB) Collecting sentencepiece (from nougat-ocr[api]) Using cached sentencepiece-0.1.99-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.3 MB) Collecting sconf>=0.2.3 (from nougat-ocr[api]) Using cached sconf-0.2.5-py3-none-any.whl (8.8 kB) Collecting albumentations>=1.0.0 (from nougat-ocr[api]) Obtaining dependency information for albumentations>=1.0.0 from https://files.pythonhosted.org/packages/9b/f6/c486cedb4f75147232f32ec4c97026714cfef7c7e247a1f0427bc5489f66/albumentations-1.3.1-py3-none-any.whl.metadata Using cached albumentations-1.3.1-py3-none-any.whl.metadata (34 kB) Collecting pypdf>=3.1.0 (from nougat-ocr[api]) Obtaining dependency information for pypdf>=3.1.0 from https://files.pythonhosted.org/packages/92/a1/4af912cb0cbde61dc7ba898c06b145be63e46a23cd3e09f83a179af60705/pypdf-3.16.1-py3-none-any.whl.metadata Using cached pypdf-3.16.1-py3-none-any.whl.metadata (7.2 kB) Collecting pypdfium2 (from nougat-ocr[api]) Obtaining dependency information for pypdfium2 from https://files.pythonhosted.org/packages/ad/b2/aff769d81353e5f3961f35cbe512bba78382f357b8b0a7fd35c438056562/pypdfium2-4.20.0-py3-none-manylinux_2_17_x86_64.whl.metadata Using cached pypdfium2-4.20.0-py3-none-manylinux_2_17_x86_64.whl.metadata (41 kB) Requirement already satisfied: fastapi in /opt/conda/lib/python3.9/site-packages (from nougat-ocr[api]) (0.100.1) Requirement already satisfied: uvicorn[standard] in /opt/conda/lib/python3.9/site-packages (from nougat-ocr[api]) (0.23.2) Collecting python-multipart (from nougat-ocr[api]) Using cached python_multipart-0.0.6-py3-none-any.whl (45 kB) Requirement already satisfied: torch>=1.4 in /opt/conda/lib/python3.9/site-packages (from timm==0.5.4->nougat-ocr[api]) (1.13.1+cu117) Requirement already satisfied: torchvision in /opt/conda/lib/python3.9/site-packages (from timm==0.5.4->nougat-ocr[api]) (0.14.1+cu117) Requirement already satisfied: numpy>=1.11.1 in /opt/conda/lib/python3.9/site-packages (from albumentations>=1.0.0->nougat-ocr[api]) (1.25.2) Requirement already satisfied: scipy>=1.1.0 in /opt/conda/lib/python3.9/site-packages (from albumentations>=1.0.0->nougat-ocr[api]) (1.11.1) Requirement already satisfied: scikit-image>=0.16.1 in /opt/conda/lib/python3.9/site-packages (from albumentations>=1.0.0->nougat-ocr[api]) (0.21.0) Requirement already satisfied: PyYAML in /opt/conda/lib/python3.9/site-packages (from albumentations>=1.0.0->nougat-ocr[api]) (6.0.1) Collecting qudida>=0.0.4 (from albumentations>=1.0.0->nougat-ocr[api]) Using cached qudida-0.0.4-py3-none-any.whl (3.5 kB) Requirement already satisfied: Jinja2<5.0 in /opt/conda/lib/python3.9/site-packages (from lightning>=2.0.0->nougat-ocr[api]) (3.1.2) Collecting arrow<3.0,>=1.2.0 (from lightning>=2.0.0->nougat-ocr[api]) Using cached arrow-1.2.3-py3-none-any.whl (66 kB) Collecting backoff<4.0,>=2.2.1 (from lightning>=2.0.0->nougat-ocr[api]) Using cached backoff-2.2.1-py3-none-any.whl (15 kB) Requirement already satisfied: beautifulsoup4<6.0,>=4.8.0 in /opt/conda/lib/python3.9/site-packages (from lightning>=2.0.0->nougat-ocr[api]) (4.12.2) Requirement already satisfied: click<10.0 in /opt/conda/lib/python3.9/site-packages (from lightning>=2.0.0->nougat-ocr[api]) (8.1.6) Collecting croniter<1.5.0,>=1.3.0 (from lightning>=2.0.0->nougat-ocr[api]) Obtaining dependency information for croniter<1.5.0,>=1.3.0 from https://files.pythonhosted.org/packages/f2/91/e5ae454da8200c6eb6cf94ca05d799b51e2cb2cc458a7737aebc0c5a21bb/croniter-1.4.1-py2.py3-none-any.whl.metadata Using cached croniter-1.4.1-py2.py3-none-any.whl.metadata (24 kB) Collecting dateutils<2.0 (from lightning>=2.0.0->nougat-ocr[api]) Using cached dateutils-0.6.12-py2.py3-none-any.whl (5.7 kB) Collecting deepdiff<8.0,>=5.7.0 (from lightning>=2.0.0->nougat-ocr[api]) Obtaining dependency information for deepdiff<8.0,>=5.7.0 from https://files.pythonhosted.org/packages/0a/aa/ad75c66354a1b3619e73879a48219488e5ea91f26569d2f1fd4ba616cacd/deepdiff-6.5.0-py3-none-any.whl.metadata Using cached deepdiff-6.5.0-py3-none-any.whl.metadata (5.3 kB) Requirement already satisfied: fsspec<2025.0,>=2022.5.0 in /opt/conda/lib/python3.9/site-packages (from lightning>=2.0.0->nougat-ocr[api]) (2023.6.0) Collecting inquirer<5.0,>=2.10.0 (from lightning>=2.0.0->nougat-ocr[api]) Using cached inquirer-3.1.3-py3-none-any.whl (18 kB) Collecting lightning-cloud>=0.5.38 (from lightning>=2.0.0->nougat-ocr[api]) Obtaining dependency information for lightning-cloud>=0.5.38 from https://files.pythonhosted.org/packages/7b/1e/9c34fc7b9aaf0d55815638b800f1f0205c39ab99e000fdc80e0b57c3463f/lightning_cloud-0.5.38-py3-none-any.whl.metadata Using cached lightning_cloud-0.5.38-py3-none-any.whl.metadata (912 bytes) Collecting lightning-utilities<2.0,>=0.7.0 (from lightning>=2.0.0->nougat-ocr[api]) Obtaining dependency information for lightning-utilities<2.0,>=0.7.0 from https://files.pythonhosted.org/packages/46/ee/8641eeb6a062f383b7d6875604e1f3f83bd2c93a0b4dbcabd3150b32de6e/lightning_utilities-0.9.0-py3-none-any.whl.metadata Using cached lightning_utilities-0.9.0-py3-none-any.whl.metadata (4.6 kB) Requirement already satisfied: packaging in /opt/conda/lib/python3.9/site-packages (from lightning>=2.0.0->nougat-ocr[api]) (23.1) Requirement already satisfied: psutil<7.0 in /opt/conda/lib/python3.9/site-packages (from lightning>=2.0.0->nougat-ocr[api]) (5.9.5) Requirement already satisfied: pydantic<2.2.0,>=1.7.4 in /opt/conda/lib/python3.9/site-packages (from lightning>=2.0.0->nougat-ocr[api]) (1.10.12) Requirement already satisfied: requests<4.0 in /opt/conda/lib/python3.9/site-packages (from lightning>=2.0.0->nougat-ocr[api]) (2.31.0) Collecting rich<15.0,>=12.3.0 (from lightning>=2.0.0->nougat-ocr[api]) Obtaining dependency information for rich<15.0,>=12.3.0 from https://files.pythonhosted.org/packages/c1/d1/23ba6235ed82883bb416f57179d1db2c05f3fb8e5d83c18660f9ab6f09c9/rich-13.5.3-py3-none-any.whl.metadata Using cached rich-13.5.3-py3-none-any.whl.metadata (18 kB) Requirement already satisfied: starlette in /opt/conda/lib/python3.9/site-packages (from lightning>=2.0.0->nougat-ocr[api]) (0.27.0) Collecting starsessions<2.0,>=1.2.1 (from lightning>=2.0.0->nougat-ocr[api]) Using cached starsessions-1.3.0-py3-none-any.whl (10 kB) Collecting torchmetrics<3.0,>=0.7.0 (from lightning>=2.0.0->nougat-ocr[api]) Obtaining dependency information for torchmetrics<3.0,>=0.7.0 from https://files.pythonhosted.org/packages/fa/86/264f2a30d7cdd2f7e93dcca840b588c002e1631d4dfc1fd6ffa4bb497d23/torchmetrics-1.1.2-py3-none-any.whl.metadata Downloading torchmetrics-1.1.2-py3-none-any.whl.metadata (21 kB) Requirement already satisfied: tqdm<6.0,>=4.57.0 in /opt/conda/lib/python3.9/site-packages (from lightning>=2.0.0->nougat-ocr[api]) (4.65.0) Requirement already satisfied: traitlets<7.0,>=5.3.0 in /opt/conda/lib/python3.9/site-packages (from lightning>=2.0.0->nougat-ocr[api]) (5.9.0) Requirement already satisfied: typing-extensions<6.0,>=4.0.0 in /opt/conda/lib/python3.9/site-packages (from lightning>=2.0.0->nougat-ocr[api]) (4.7.1) Requirement already satisfied: urllib3<4.0 in /opt/conda/lib/python3.9/site-packages (from lightning>=2.0.0->nougat-ocr[api]) (1.26.16) Requirement already satisfied: websocket-client<3.0 in /opt/conda/lib/python3.9/site-packages (from lightning>=2.0.0->nougat-ocr[api]) (1.6.1) Collecting websockets<13.0 (from lightning>=2.0.0->nougat-ocr[api]) Downloading websockets-11.0.3-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (129 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 129.7/129.7 kB 305.2 kB/s eta 0:00:00a 0:00:01 Collecting pytorch-lightning (from lightning>=2.0.0->nougat-ocr[api]) Obtaining dependency information for pytorch-lightning from https://files.pythonhosted.org/packages/fa/c7/18aca7e74b6c4bb99ceb76a7742716543f040834b8440acad4afaf528e46/pytorch_lightning-2.0.9-py3-none-any.whl.metadata Downloading pytorch_lightning-2.0.9-py3-none-any.whl.metadata (23 kB) INFO: pip is looking at multiple versions of sconf to determine which version is compatible with other requirements. This could take a while. Collecting sconf>=0.2.3 (from nougat-ocr[api]) Downloading sconf-0.2.4-py3-none-any.whl (8.8 kB) Downloading sconf-0.2.3-py3-none-any.whl (8.6 kB) Collecting nougat-ocr[api] Obtaining dependency information for nougat-ocr[api] from https://files.pythonhosted.org/packages/be/d6/7abc208b7a529ecbd69e9f7694f8253f91ecc512eafd6f65f6b506b4e6e7/nougat_ocr-0.1.10-py3-none-any.whl.metadata Downloading nougat_ocr-0.1.10-py3-none-any.whl.metadata (9.9 kB) Obtaining dependency information for nougat-ocr[api] from https://files.pythonhosted.org/packages/f1/3f/92209f66fd5ada5e50240b7ced1215a87e6181ffa237912fc5336ce61c45/nougat_ocr-0.1.8-py3-none-any.whl.metadata Downloading nougat_ocr-0.1.8-py3-none-any.whl.metadata (9.8 kB) Collecting pymupdf (from nougat-ocr[api]) Obtaining dependency information for pymupdf from https://files.pythonhosted.org/packages/da/4f/a2b9479145cca44d30706ac3612c6d8c6aecae962b85c833fbe0012b4050/PyMuPDF-1.23.3-cp39-none-manylinux2014_x86_64.whl.metadata Downloading PyMuPDF-1.23.3-cp39-none-manylinux2014_x86_64.whl.metadata (3.4 kB) INFO: pip is still looking at multiple versions of sconf to determine which version is compatible with other requirements. This could take a while. Collecting nougat-ocr[api] Obtaining dependency information for nougat-ocr[api] from https://files.pythonhosted.org/packages/93/56/5730e5ff5e936fa1bc377c4d5412c94a38ae1096ecc50dabdaedb5c888a5/nougat_ocr-0.1.7-py3-none-any.whl.metadata Downloading nougat_ocr-0.1.7-py3-none-any.whl.metadata (9.8 kB) Obtaining dependency information for nougat-ocr[api] from https://files.pythonhosted.org/packages/44/d1/aabde7adb6778b6f4f9d70d8dd5af0552b0f31942afacbbada5926d02097/nougat_ocr-0.1.6-py3-none-any.whl.metadata Downloading nougat_ocr-0.1.6-py3-none-any.whl.metadata (8.9 kB) INFO: This is taking longer than usual. You might need to provide the dependency resolver with stricter constraints to reduce runtime. See https://pip.pypa.io/warnings/backtracking for guidance. If you want to abort this run, press Ctrl + C. Obtaining dependency information for nougat-ocr[api] from https://files.pythonhosted.org/packages/20/8b/77ef0c5a1b8badb167d1e0e544393347e3cb0f9821e4006e85460f6ac68a/nougat_ocr-0.1.5-py3-none-any.whl.metadata Downloading nougat_ocr-0.1.5-py3-none-any.whl.metadata (8.3 kB) Obtaining dependency information for nougat-ocr[api] from https://files.pythonhosted.org/packages/b1/41/240f50e4e8a44f7c4d5f04b91b9948695d700bc47d18f87fae94934f7667/nougat_ocr-0.1.4-py3-none-any.whl.metadata Downloading nougat_ocr-0.1.4-py3-none-any.whl.metadata (8.3 kB) Obtaining dependency information for nougat-ocr[api] from https://files.pythonhosted.org/packages/a0/56/c9e93ed13a7261e12dee6b88141f12bf69efd56c1d5c88637f5afafff710/nougat_ocr-0.1.3-py3-none-any.whl.metadata Downloading nougat_ocr-0.1.3-py3-none-any.whl.metadata (7.9 kB) Obtaining dependency information for nougat-ocr[api] from https://files.pythonhosted.org/packages/ba/db/357d62c99271d7a7741a673de83bfdbea1bcb862377beac88cf15b227642/nougat_ocr-0.1.2-py3-none-any.whl.metadata Downloading nougat_ocr-0.1.2-py3-none-any.whl.metadata (7.4 kB) Obtaining dependency information for nougat-ocr[api] from https://files.pythonhosted.org/packages/c5/67/57747ee7b827c52d567ea722e4fa565ee3279d48d1dfed6f144e68660ccc/nougat_ocr-0.1.1-py3-none-any.whl.metadata Downloading nougat_ocr-0.1.1-py3-none-any.whl.metadata (7.5 kB) Collecting transformers~=4.25.1 (from nougat-ocr[api]) Downloading transformers-4.25.1-py3-none-any.whl (5.8 MB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 5.8/5.8 MB 837.9 kB/s eta 0:00:0000:0100:01 Collecting nougat-ocr[api] Obtaining dependency information for nougat-ocr[api] from https://files.pythonhosted.org/packages/14/c1/54623eae2cb9a85232b3a51b10ba7510cec677d642eceb6a5976b74659fd/nougat_ocr-0.1.0.post1-py3-none-any.whl.metadata Downloading nougat_ocr-0.1.0.post1-py3-none-any.whl.metadata (7.4 kB) Obtaining dependency information for nougat-ocr[api] from https://files.pythonhosted.org/packages/51/55/825823806e7010613784a567feed16000ae14ff09bb87ca2360982a63857/nougat_ocr-0.1.0-py3-none-any.whl.metadata Downloading nougat_ocr-0.1.0-py3-none-any.whl.metadata (7.4 kB) ERROR: Cannot install nougat-ocr because these package versions have conflicting dependencies.

The conflict is caused by: sconf 0.2.5 depends on ruamel.yaml sconf 0.2.4 depends on ruamel.yaml sconf 0.2.3 depends on ruamel.yaml

To fix this you could try to:

  1. loosen the range of package versions you've specified
  2. remove package versions to allow pip attempt to solve the dependency conflict

ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/topics/dependency-resolution/#dealing-with-dependency-conflicts

lukas-blecher commented 1 year ago

what python version are you using, and was this a fresh installation/virtual environment?