0

I am trying to install tesserocr and I am getting the below error when I do pip install tesserocr Here is the setup which I have done. Want to know what is the issue and how can I resolve it ?

  1. Downloaded the latest from https://github.com/UB-Mannheim/tesseract/wiki
  2. Set the path for Tesseract-OCR in the environment variables.

Error below WARNING: Ignoring invalid distribution -mportlib-metadata (c:\programdata\anaconda3\lib\site-packages) Collecting tesserocr Using cached tesserocr-2.6.1.tar.gz (58 kB) Installing build dependencies ... done Getting requirements to build wheel ... error error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully. │ exit code: 1 ╰─> [50 lines of output] Failed to extract tesseract version number from: tesseract v5.3.1.20230401

   leptonica-1.83.1
    libgif 5.2.1 : libjpeg 8d (libjpeg-turbo 2.1.4) : libpng 1.6.39 : libtiff 4.5.0 : zlib 1.2.13 : libwebp 1.3.0 : libopenjp2 2.5.0

   Found AVX2

   Found AVX

   Found FMA

   Found SSE4.1

   Found libarchive 3.6.2 zlib/1.2.13 liblzma/5.2.9 bz2lib/1.0.8 liblz4/1.9.4 libzstd/1.5.2

   Found libcurl/8.0.1 Schannel zlib/1.2.13 brotli/1.0.9 zstd/1.5.4 libidn2/2.3.4 libpsl/0.21.2 (+libidn2/2.3.3) libssh2/1.10.0
  Supporting tesseract v3.04.00
  Tesseract major version 3
  Traceback (most recent call last):
    File "<string>", line 243, in get_build_args
    File "<string>", line 99, in package_config
    File "C:\ProgramData\Anaconda3\lib\subprocess.py", line 854, in __init__
      self._execute_child(args, executable, preexec_fn, close_fds,
    File "C:\ProgramData\Anaconda3\lib\subprocess.py", line 1307, in _execute_child
      hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
  FileNotFoundError: [WinError 2] The system cannot find the file specified

  During handling of the above exception, another exception occurred:

  Traceback (most recent call last):
    File "C:\ProgramData\Anaconda3\lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 353, in <module>
      main()
    File "C:\ProgramData\Anaconda3\lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 335, in main
      json_out['return_val'] = hook(**hook_input['kwargs'])
    File "C:\ProgramData\Anaconda3\lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 118, in get_requires_for_build_wheel
      return hook(config_settings)
    File "C:\Users\test\AppData\Local\Temp\pip-build-env-89658jrl\overlay\Lib\site-packages\setuptools\build_meta.py", line 341, in get_requires_for_build_wheel
      return self._get_build_requires(config_settings, requirements=['wheel'])
    File "C:\Users\test\AppData\Local\Temp\pip-build-env-89658jrl\overlay\Lib\site-packages\setuptools\build_meta.py", line 323, in _get_build_requires
      self.run_setup()
    File "C:\Users\test\AppData\Local\Temp\pip-build-env-89658jrl\overlay\Lib\site-packages\setuptools\build_meta.py", line 487, in run_setup
      super(_BuildMetaLegacyBackend,
    File "C:\Users\test\AppData\Local\Temp\pip-build-env-89658jrl\overlay\Lib\site-packages\setuptools\build_meta.py", line 338, in run_setup
      exec(code, locals())
    File "<string>", line 329, in <module>
    File "<string>", line 260, in make_extension
    File "<string>", line 252, in get_build_args
    File "<string>", line 216, in get_tesseract_version
  RuntimeError: Tesseract library not found in LIBPATH: []
  [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip. error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully. │ exit code: 1 ╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.

VBha
  • 17
  • 3

1 Answers1

0

Follow instruction on tesserocr for windows or install prebuild wheel from https://github.com/simonflueckiger/tesserocr-windows_build/releases

user898678
  • 2,994
  • 2
  • 18
  • 17
  • Tried this. But it is erroring out with error "WARNING: Ignoring invalid distribution -mportlib-metadata (c:\programdata\anaconda3\lib\site-packages) ERROR: Could not find a version that satisfies the requirement tesserocr-2.6.0-cp310-cp310-win_amd64 (from versions: none) ERROR: No matching distribution found for tesserocr-2.6.0-cp310-cp310-win_amd64" – VBha Aug 10 '23 at 16:33
  • How did you "try that"? Showing an error message without steps to reproduce the problem is useless – user898678 Aug 12 '23 at 07:51
  • Resolved the error and found a work around for the same. Thank you. Means a lot – VBha Aug 28 '23 at 16:16