Failed To install using pip

See original GitHub issue

Bug description

I was expecting the python-doctr using pip

Code snippet to reproduce the bug

pip install python-doctr

Error traceback

Collecting python-doctr
  Using cached python_doctr-0.5.1-py3-none-any.whl (205 kB)
Requirement already satisfied: h5py>=3.1.0 in c:\users\user\appdata\local\programs\python\python310\lib\site-packages (from python-doctr) (3.6.0)
Requirement already satisfied: shapely>=1.6.0 in c:\users\user\appdata\local\programs\python\python310\lib\site-packages (from python-doctr) (1.8.4)
Requirement already satisfied: pypdfium2>=1.0.0 in c:\users\user\appdata\local\programs\python\python310\lib\site-packages (from python-doctr) (2.10.0)
Requirement already satisfied: unidecode>=1.0.0 in c:\users\user\appdata\local\programs\python\python310\lib\site-packages (from python-doctr) (1.3.4)
Collecting huggingface-hub>=0.4.0
  Using cached huggingface_hub-0.8.1-py3-none-any.whl (101 kB)
Requirement already satisfied: opencv-python>=3.4.5.20 in c:\users\user\appdata\local\programs\python\python310\lib\site-packages (from python-doctr) (4.6.0.66)
Requirement already satisfied: scipy>=1.4.0 in c:\users\user\appdata\local\programs\python\python310\lib\site-packages (from python-doctr) (1.8.0)
Requirement already satisfied: numpy>=1.16.0 in c:\users\user\appdata\local\programs\python\python310\lib\site-packages (from python-doctr) (1.23.2)
Collecting matplotlib<3.4.3,>=3.1.0
  Using cached matplotlib-3.4.2.tar.gz (37.3 MB)
  Preparing metadata (setup.py) ... done
Collecting mplcursors>=0.3
  Using cached mplcursors-0.5.1-py3-none-any.whl
Requirement already satisfied: Pillow>=8.3.2 in c:\users\user\appdata\local\programs\python\python310\lib\site-packages (from python-doctr) (9.2.0)
Requirement already satisfied: rapidfuzz>=1.6.0 in c:\users\user\appdata\local\programs\python\python310\lib\site-packages (from python-doctr) (2.6.0)
Requirement already satisfied: tqdm>=4.30.0 in c:\users\user\appdata\local\programs\python\python310\lib\site-packages (from python-doctr) (4.63.0)
Collecting weasyprint<53.0,>=52.2
  Using cached WeasyPrint-52.5-py3-none-any.whl (365 kB)
Requirement already satisfied: pyclipper>=1.2.0 in c:\users\user\appdata\local\programs\python\python310\lib\site-packages (from python-doctr) (1.3.0.post3)
Requirement already satisfied: pyyaml>=5.1 in c:\users\user\appdata\local\programs\python\python310\lib\site-packages (from huggingface-hub>=0.4.0->python-doctr) (6.0)
Requirement already satisfied: requests in c:\users\user\appdata\local\programs\python\python310\lib\site-packages (from huggingface-hub>=0.4.0->python-doctr) (2.28.1)
Requirement already satisfied: packaging>=20.9 in c:\users\user\appdata\local\programs\python\python310\lib\site-packages (from huggingface-hub>=0.4.0->python-doctr) (21.3)
Requirement already satisfied: typing-extensions>=3.7.4.3 in c:\users\user\appdata\local\programs\python\python310\lib\site-packages (from huggingface-hub>=0.4.0->python-doctr) (4.1.1)
Requirement already satisfied: filelock in c:\users\user\appdata\local\programs\python\python310\lib\site-packages (from huggingface-hub>=0.4.0->python-doctr) (3.6.0)
Requirement already satisfied: cycler>=0.10 in c:\users\user\appdata\local\programs\python\python310\lib\site-packages (from matplotlib<3.4.3,>=3.1.0->python-doctr) (0.11.0)
Requirement already satisfied: kiwisolver>=1.0.1 in c:\users\user\appdata\local\programs\python\python310\lib\site-packages (from matplotlib<3.4.3,>=3.1.0->python-doctr) (1.4.2)
Requirement already satisfied: pyparsing>=2.2.1 in c:\users\user\appdata\local\programs\python\python310\lib\site-packages (from matplotlib<3.4.3,>=3.1.0->python-doctr) (3.0.6)
Requirement already satisfied: python-dateutil>=2.7 in c:\users\user\appdata\local\programs\python\python310\lib\site-packages (from matplotlib<3.4.3,>=3.1.0->python-doctr) (2.8.2)
Requirement already satisfied: jarowinkler<2.0.0,>=1.2.0 in c:\users\user\appdata\local\programs\python\python310\lib\site-packages (from rapidfuzz>=1.6.0->python-doctr) (1.2.1)
Requirement already satisfied: colorama in c:\users\user\appdata\local\programs\python\python310\lib\site-packages (from tqdm>=4.30.0->python-doctr) (0.4.4)
Collecting CairoSVG>=2.4.0
  Using cached CairoSVG-2.5.2-py3-none-any.whl (45 kB)
Requirement already satisfied: cffi>=0.6 in c:\users\user\appdata\local\programs\python\python310\lib\site-packages (from weasyprint<53.0,>=52.2->python-doctr) (1.15.0)
Requirement already satisfied: Pyphen>=0.9.1 in c:\users\user\appdata\local\programs\python\python310\lib\site-packages (from weasyprint<53.0,>=52.2->python-doctr) (0.12.0)
Requirement already satisfied: html5lib>=0.999999999 in c:\users\user\appdata\local\programs\python\python310\lib\site-packages (from weasyprint<53.0,>=52.2->python-doctr) (1.1)
Requirement already satisfied: setuptools>=39.2.0 in c:\users\user\appdata\local\programs\python\python310\lib\site-packages (from weasyprint<53.0,>=52.2->python-doctr) (60.9.3)
Requirement already satisfied: tinycss2>=1.0.0 in c:\users\user\appdata\local\programs\python\python310\lib\site-packages (from weasyprint<53.0,>=52.2->python-doctr) (1.1.1)
Collecting cssselect2>=0.1
  Using cached cssselect2-0.6.0-py3-none-any.whl (15 kB)
Collecting cairocffi>=0.9.0
  Using cached cairocffi-1.3.0-py3-none-any.whl
Requirement already satisfied: defusedxml in c:\users\user\appdata\local\programs\python\python310\lib\site-packages (from CairoSVG>=2.4.0->weasyprint<53.0,>=52.2->python-doctr) (0.7.1)
Requirement already satisfied: pycparser in c:\users\user\appdata\local\programs\python\python310\lib\site-packages (from cffi>=0.6->weasyprint<53.0,>=52.2->python-doctr) (2.21)
Requirement already satisfied: webencodings in c:\users\user\appdata\local\programs\python\python310\lib\site-packages (from cssselect2>=0.1->weasyprint<53.0,>=52.2->python-doctr) (0.5.1)
Requirement already satisfied: six>=1.9 in c:\users\user\appdata\local\programs\python\python310\lib\site-packages (from html5lib>=0.999999999->weasyprint<53.0,>=52.2->python-doctr) (1.16.0)
Requirement already satisfied: certifi>=2017.4.17 in c:\users\user\appdata\local\programs\python\python310\lib\site-packages (from requests->huggingface-hub>=0.4.0->python-doctr) (2021.10.8)
Requirement already satisfied: idna<4,>=2.5 in c:\users\user\appdata\local\programs\python\python310\lib\site-packages (from requests->huggingface-hub>=0.4.0->python-doctr) (2.10)
Requirement already satisfied: charset-normalizer<3,>=2 in c:\users\user\appdata\local\programs\python\python310\lib\site-packages (from requests->huggingface-hub>=0.4.0->python-doctr) (2.0.12)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in c:\users\user\appdata\local\programs\python\python310\lib\site-packages (from requests->huggingface-hub>=0.4.0->python-doctr) (1.26.8)
Building wheels for collected packages: matplotlib
  Building wheel for matplotlib (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [552 lines of output]

      Edit setup.cfg to change the build options; suppress output with --quiet.

      BUILDING MATPLOTLIB
        matplotlib: yes [3.4.2]
            python: yes [3.10.2 (tags/v3.10.2:a58ebcc, Jan 17 2022, 14:12:15) [MSC
                        v.1929 64 bit (AMD64)]]
          platform: yes [win32]
             tests: no  [skipping due to configuration]
            macosx: no  [Mac OS-X only]

      running bdist_wheel
      running build
      running build_py
      creating build
      creating build\lib.win-amd64-3.10
      copying lib\pylab.py -> build\lib.win-amd64-3.10
      creating build\lib.win-amd64-3.10\matplotlib
      [just a lot of matplot lib file coping here...]
      UPDATING build\lib.win-amd64-3.10\matplotlib\_version.py
      set build\lib.win-amd64-3.10\matplotlib\_version.py to '3.4.2'
      running build_ext
      Extracting /project/freetype/freetype2/2.6.1/freetype-2.6.1.tar.gz
      Building freetype in build\freetype-2.6.1
      msbuild build\freetype-2.6.1\builds\windows\vc2010\freetype.sln /t:Clean;Build /p:Configuration=Release;Platform=x64
      error: command 'msbuild' failed: None
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for matplotlib
  Running setup.py clean for matplotlib
Failed to build matplotlib
Installing collected packages: matplotlib, huggingface-hub, cssselect2, cairocffi, mplcursors, CairoSVG, weasyprint, python-doctr
  Attempting uninstall: matplotlib
    Found existing installation: matplotlib 3.5.1
    Uninstalling matplotlib-3.5.1:
      Successfully uninstalled matplotlib-3.5.1
  Running setup.py install for matplotlib ... error
  error: subprocess-exited-with-error

  × Running setup.py install for matplotlib did not run successfully.
  │ exit code: 1
  ╰─> [552 lines of output]

      Edit setup.cfg to change the build options; suppress output with --quiet.

      BUILDING MATPLOTLIB
        matplotlib: yes [3.4.2]
            python: yes [3.10.2 (tags/v3.10.2:a58ebcc, Jan 17 2022, 14:12:15) [MSC
                        v.1929 64 bit (AMD64)]]
          platform: yes [win32]
             tests: no  [skipping due to configuration]
            macosx: no  [Mac OS-X only]

      running install
      C:\Users\user\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\command\install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
        warnings.warn(
      running build
      running build_py
      creating build\lib.win-amd64-3.10
      copying lib\pylab.py -> build\lib.win-amd64-3.10
      creating build\lib.win-amd64-3.10\matplotlib
      [just a lot of matplot lib file coping here...]
      UPDATING build\lib.win-amd64-3.10\matplotlib\_version.py
      set build\lib.win-amd64-3.10\matplotlib\_version.py to '3.4.2'
      running build_ext
      Building freetype in build\freetype-2.6.1
      msbuild build\freetype-2.6.1\builds\windows\vc2010\freetype.sln /t:Clean;Build /p:Configuration=Release;Platform=x64
      error: command 'msbuild' failed: None
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  Rolling back uninstall of matplotlib
  [rollback removed to solve for too long error]
error: legacy-install-failure

× Encountered error while trying to install package.
╰─> matplotlib

note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.

Environment

Collecting environment information…

DocTR version: N/A TensorFlow version: 2.8.0 PyTorch version: 1.12.1+cpu (torchvision 0.13.1+cpu) OpenCV version: 4.5.4 OS: Microsoft Windows 11 Pro Python version: 3.10.2 Is CUDA available (TensorFlow): No Is CUDA available (PyTorch): No CUDA runtime version: No CUDA GPU models and configuration: No CUDA Nvidia driver version: No CUDA cuDNN version: No CUDA

Deep Learning backend

As per how I got this output if the installment failed. I found the file in the source code and ran it

is_tf_available: True
is_torch_available: True

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:9 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
felixdittrich92commented, Aug 31, 2022

@frgfm Unfortunately it needs wkhtmltopdf on Linux to read urls to pdf

0reactions
felixdittrich92commented, Sep 10, 2022

Nice thanks for the Update 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to install modules with PIP (and fix it when it fails) - Medium
First make sure that you have installed Python.​​ The main way to do this is to go to PyPi and search for your...
Read more >
pip fails to install anything, error: invalid command 'egg_info'
This is when I began to have problems installing packages with pip. sudo pip install -vvv pygoogle. Will output the following: The directory...
Read more >
pip Install Third-Party Library Error
If an error is reported, it may be that the environment variables are not configured when installing Python under Windows. You can configure...
Read more >
How to Install Pip on Windows - ActiveState
One of the most common problems with running Python tools like pip is the “not on PATH” error. This means that Python cannot...
Read more >
Pip install fails | Apple Developer Forums
Pip install fails · 1) apparently successful install of beta · 2) xcode command line tools installed via terminal · 3) python -V...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found