鱼C论坛

 找回密码
 立即注册
查看: 663|回复: 5

安装tesserocr,Getting requirements to build wheel did not run successfully.

[复制链接]
发表于 2024-2-22 13:17:16 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能^_^

您需要 登录 才可以下载或查看,没有账号?立即注册

x
C:\Users\20962>pip install tesserocr -i
Looking in indexes:
Collecting tesserocr
  Using cached  (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
  ╰─> [34 lines of output]
      Failed to extract tesseract version from executable: [WinError 2] 系统找不到指定的文件。
      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:\Users\20962\AppData\Local\Programs\Python\Python39\lib\subprocess.py", line 951, in __init__
          self._execute_child(args, executable, preexec_fn, close_fds,
        File "C:\Users\20962\AppData\Local\Programs\Python\Python39\lib\subprocess.py", line 1420, in _execute_child
          hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
      FileNotFoundError: [WinError 2] 系统找不到指定的文件。

      During handling of the above exception, another exception occurred:

      Traceback (most recent call last):
        File "C:\Users\20962\AppData\Local\Programs\Python\Python39\lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 353, in <module>
          main()
        File "C:\Users\20962\AppData\Local\Programs\Python\Python39\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:\Users\20962\AppData\Local\Programs\Python\Python39\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\20962\AppData\Local\Temp\pip-build-env-1r08aa75\overlay\Lib\site-packages\setuptools\build_meta.py", line 325, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=['wheel'])
        File "C:\Users\20962\AppData\Local\Temp\pip-build-env-1r08aa75\overlay\Lib\site-packages\setuptools\build_meta.py", line 295, in _get_build_requires
          self.run_setup()
        File "C:\Users\20962\AppData\Local\Temp\pip-build-env-1r08aa75\overlay\Lib\site-packages\setuptools\build_meta.py", line 480, in run_setup
          super().run_setup(setup_script=setup_script)
        File "C:\Users\20962\AppData\Local\Temp\pip-build-env-1r08aa75\overlay\Lib\site-packages\setuptools\build_meta.py", line 311, in run_setup
          exec(code, locals())
        File "<string>", line 330, 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.

本帖被以下淘专辑推荐:

想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复

使用道具 举报

发表于 2024-2-22 13:17:48 | 显示全部楼层
这个错误是由于安装tesserocr时没有找到tesseract库所致。tesserocr是一个用于与Tesseract OCR引擎交互的Python包。在安装tesserocr之前,您需要确保已正确安装了Tesseract OCR引擎。

您可以按照以下步骤安装Tesseract OCR引擎:

1. 访问https://github.com/UB-Mannheim/tesseract/wiki下载适用于您的操作系统的最新版本的Tesseract OCR引擎。
2. 安装下载的Tesseract OCR引擎。在Windows上,您可以将其解压缩到一个易于访问的位置,例如`C:\Program Files\Tesseract-OCR`。
3. 将Tesseract OCR引擎的路径添加到系统环境变量中。在Windows上,您可以按如下步骤添加环境变量:
   - 打开控制面板,并进入“系统和安全” -> “系统” -> “高级系统设置” -> “环境变量”。
   - 在“系统变量”部分,找到“PATH”变量并点击“编辑”。
   - 在“变量值”字段中添加Tesseract OCR引擎的路径,例如`C:\Program Files\Tesseract-OCR`(请根据实际路径进行更改)。
   - 确认更改并关闭所有打开的窗口。

完成上述步骤后,您应该能够成功安装tesserocr了。运行以下命令进行安装:
pip install tesserocr

如果您已经按照上述步骤安装了Tesseract OCR引擎,但仍然遇到问题,请检查系统环境变量是否正确设置,以确保可以找到Tesseract OCR引擎。如果问题仍然存在,请尝试重新启动计算机并再次运行安装命令。

希望这能帮助您解决问题。如果还有其他疑问,请随时提问。

以上回复来自 FishC AI 小助理,如未能正确解答您的问题,请继续追问。
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2024-2-22 13:22:50 | 显示全部楼层
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复 支持 反对

使用道具 举报

 楼主| 发表于 2024-2-22 14:34:05 | 显示全部楼层
歌者文明清理员 发表于 2024-2-22 13:22
https://fishc.com.cn/thread-225497-1-1.html

在pypi上我没看见window版本的whl
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复 支持 反对

使用道具 举报

 楼主| 发表于 2024-2-22 14:37:50 | 显示全部楼层
FishC 发表于 2024-2-22 13:17
这个错误是由于安装tesserocr时没有找到tesseract库所致。tesserocr是一个用于与Tesseract OCR引擎交互的Py ...

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.3.20231005

       leptonica-1.83.1

        libgif 5.2.1 : libjpeg 8d (libjpeg-turbo 2.1.4) : libpng 1.6.40 : libtiff 4.6.0 : zlib 1.2.13 : libwebp 1.3.2 : libopenjp2 2.5.0

       Found AVX2

       Found AVX

       Found FMA

       Found SSE4.1

       Found libarchive 3.7.2 zlib/1.3 liblzma/5.4.4 bz2lib/1.0.8 liblz4/1.9.4 libzstd/1.5.5

       Found libcurl/8.3.0 Schannel zlib/1.3 brotli/1.1.0 zstd/1.5.5 libidn2/2.3.4 libpsl/0.21.2 (+libidn2/2.3.3) libssh2/1.11.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:\Users\20962\AppData\Local\Programs\Python\Python39\lib\subprocess.py", line 951, in __init__
          self._execute_child(args, executable, preexec_fn, close_fds,
        File "C:\Users\20962\AppData\Local\Programs\Python\Python39\lib\subprocess.py", line 1420, in _execute_child
          hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
      FileNotFoundError: [WinError 2] 系统找不到指定的文件。

      During handling of the above exception, another exception occurred:

      Traceback (most recent call last):
        File "C:\Users\20962\AppData\Local\Programs\Python\Python39\lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 353, in <module>
          main()
        File "C:\Users\20962\AppData\Local\Programs\Python\Python39\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:\Users\20962\AppData\Local\Programs\Python\Python39\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\20962\AppData\Local\Temp\pip-build-env-8ulsnle5\overlay\Lib\site-packages\setuptools\build_meta.py", line 325, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=['wheel'])
        File "C:\Users\20962\AppData\Local\Temp\pip-build-env-8ulsnle5\overlay\Lib\site-packages\setuptools\build_meta.py", line 295, in _get_build_requires
          self.run_setup()
        File "C:\Users\20962\AppData\Local\Temp\pip-build-env-8ulsnle5\overlay\Lib\site-packages\setuptools\build_meta.py", line 480, in run_setup
          super().run_setup(setup_script=setup_script)
        File "C:\Users\20962\AppData\Local\Temp\pip-build-env-8ulsnle5\overlay\Lib\site-packages\setuptools\build_meta.py", line 311, in run_setup
          exec(code, locals())
        File "<string>", line 330, 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.
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2024-2-22 14:38:30 | 显示全部楼层
舍命伴君行 发表于 2024-02-22 14:37
Getting requirements to build wheel did not run su ...


这个错误表明您的系统中无法找到Tesseract OCR引擎的库文件。您可以按照以下步骤尝试解决这个问题:

1. 打开https://github.com/UB-Mannheim/tesseract/releases页面,在“Assets”部分下载适用于您的操作系统的Tesseract OCR引擎二进制文件(.exe文件)。

2. 安装下载的Tesseract OCR引擎。在Windows上,双击下载的.exe文件并按照安装向导进行操作。如果已经安装过,请确保您的Tesseract OCR引擎版本与tesserocr所需的版本兼容。

3. 添加Tesseract OCR引擎的安装路径到系统环境变量中。在Windows上,按下Win + R打开运行窗口,输入`sysdm.cpl`并按下Enter键打开系统属性。在弹出的窗口中,点击“高级”选项卡,然后点击“环境变量”按钮。在系统变量部分的“Path”变量中添加Tesseract OCR引擎的安装路径,例如`C:\Program Files\Tesseract-OCR`(请根据实际安装路径进行修改)。

4. 重启计算机以使环境变量生效。

完成上述步骤后,您应该能够成功安装tesserocr了。运行以下命令进行安装:
pip install tesserocr

希望这能解决您的问题。如果还有其他疑问,请随时提问。

以上回复来自 FishC AI 小助理,如未能正确解答您的问题,请继续追问。
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Archiver|鱼C工作室 ( 粤ICP备18085999号-1 | 粤公网安备 44051102000585号)

GMT+8, 2024-9-22 06:55

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表