m0_64536663 2022-01-04 17:20 采纳率: 50%
浏览 440
已结题

用pip装Tesserocr一直报错

刚开始装我先装的tesseract,之后装tesserocr,一直报错,后来在论坛上找资料,说要下载whl,我下载了之后,也把tesseract的变量添加之后,用pip下载tesserocr还一直报错,整整两天了,这个一直装不上去,想砸电脑了,我的是window 10电脑,tesseract4.0,whl2.4.0,python3.7.8,下面是控制台报错内容,求解惑

C:\Users\admin>pip3 install tesserocr pillow

Collecting tesserocr
Using cached tesserocr-2.5.2.tar.gz (57 kB)
Preparing metadata (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: 'd:\python\python3.7.8\python.exe' -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\admin\AppData\Local\Temp\pip-install-2wea8lhn\tesserocr_6d2771e22f8b46c08558d86ff72bcf24\setup.py'"'"'; file='"'"'C:\Users\admin\AppData\Local\Temp\pip-install-2wea8lhn\tesserocr_6d2771e22f8b46c08558d86ff72bcf24\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(file) if os.path.exists(file) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\admin\AppData\Local\Temp\pip-pip-egg-info-7wcu9b_n'
cwd: C:\Users\admin\AppData\Local\Temp\pip-install-2wea8lhn\tesserocr_6d2771e22f8b46c08558d86ff72bcf24
Complete output (27 lines):
Failed to extract tesseract version from executable: [WinError 2] 系统找不到指定的文件。
Supporting tesseract v3.04.00
Tesseract major version 3
Traceback (most recent call last):
File "C:\Users\admin\AppData\Local\Temp\pip-install-2wea8lhn\tesserocr_6d2771e22f8b46c08558d86ff72bcf24\setup.py", line 243, in get_build_args
build_args = package_config()
File "C:\Users\admin\AppData\Local\Temp\pip-install-2wea8lhn\tesserocr_6d2771e22f8b46c08558d86ff72bcf24\setup.py", line 107, in package_config
stderr=subprocess.PIPE,
File "d:\python\python3.7.8\lib\subprocess.py", line 800, in init
restore_signals, start_new_session)
File "d:\python\python3.7.8\lib\subprocess.py", line 1207, in _execute_child
startupinfo)
FileNotFoundError: [WinError 2] 系统找不到指定的文件。

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "", line 1, in
File "C:\Users\admin\AppData\Local\Temp\pip-install-2wea8lhn\tesserocr_6d2771e22f8b46c08558d86ff72bcf24\setup.py", line 327, in
ext_modules=[make_extension()],
File "C:\Users\admin\AppData\Local\Temp\pip-install-2wea8lhn\tesserocr_6d2771e22f8b46c08558d86ff72bcf24\setup.py", line 260, in make_extension
build_args = get_build_args()
File "C:\Users\admin\AppData\Local\Temp\pip-install-2wea8lhn\tesserocr_6d2771e22f8b46c08558d86ff72bcf24\setup.py", line 252, in get_build_args
build_args = get_tesseract_version()
File "C:\Users\admin\AppData\Local\Temp\pip-install-2wea8lhn\tesserocr_6d2771e22f8b46c08558d86ff72bcf24\setup.py", line 216, in get_tesseract_version
raise RuntimeError(error)
RuntimeError: Tesseract library not found in LIBPATH: []


WARNING: Discarding https://files.pythonhosted.org/packages/66/01/05cdb20f2842993d134a1a52a34f45bfa40cc4b8480cce2cb654e2eff5ed/tesserocr-2.5.2.tar.gz#sha256=9371dd3f6fe3238039c73bfe15bcaf21389f7e75f62bd530a30110149f39b2ae (from https://pypi.org/simple/tesserocr/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
Using cached tesserocr-2.5.1.tar.gz (54 kB)
Preparing metadata (setup.py) ... done
Collecting pillow
Using cached Pillow-9.0.0-cp37-cp37m-win_amd64.whl (3.2 MB)
Building wheels for collected packages: tesserocr
Building wheel for tesserocr (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: 'd:\python\python3.7.8\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\admin\AppData\Local\Temp\pip-install-2wea8lhn\tesserocr_7c968dbcd0f74c6fb91abd8cd2f99d3a\setup.py'"'"'; file='"'"'C:\Users\admin\AppData\Local\Temp\pip-install-2wea8lhn\tesserocr_7c968dbcd0f74c6fb91abd8cd2f99d3a\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(file) if os.path.exists(file) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' bdist_wheel -d 'C:\Users\admin\AppData\Local\Temp\pip-wheel-3dxlttmu'
cwd: C:\Users\admin\AppData\Local\Temp\pip-install-2wea8lhn\tesserocr_7c968dbcd0f74c6fb91abd8cd2f99d3a
Complete output (10 lines):
C:\Users\admin\AppData\Local\Temp\pip-install-2wea8lhn\tesserocr_7c968dbcd0f74c6fb91abd8cd2f99d3a\setup.py:135: DeprecationWarning: The 'warn' method is deprecated, use 'warning' instead
_LOGGER.warn('Failed to extract tesseract version from executable: {}'.format(e))
Failed to extract tesseract version from executable: [WinError 2] 系统找不到指定的文件。
Supporting tesseract v3.04.00
Building with configs: {'libraries': ['tesseract', 'lept'], 'cython_compile_time_env': {'TESSERACT_VERSION': 50593792}}
running bdist_wheel
running build
running build_ext
building 'tesserocr' extension
error: Microsoft Visual C++ 14.0 is required. Get it with "Build Tools for Visual Studio": https://visualstudio.microsoft.com/downloads/


ERROR: Failed building wheel for tesserocr
Running setup.py clean for tesserocr
Failed to build tesserocr
Installing collected packages: tesserocr, pillow
Running setup.py install for tesserocr ... error
ERROR: Command errored out with exit status 1:
command: 'd:\python\python3.7.8\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\admin\AppData\Local\Temp\pip-install-2wea8lhn\tesserocr_7c968dbcd0f74c6fb91abd8cd2f99d3a\setup.py'"'"'; file='"'"'C:\Users\admin\AppData\Local\Temp\pip-install-2wea8lhn\tesserocr_7c968dbcd0f74c6fb91abd8cd2f99d3a\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(file) if os.path.exists(file) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record 'C:\Users\admin\AppData\Local\Temp\pip-record-04bmt0h5\install-record.txt' --single-version-externally-managed --compile --install-headers 'd:\python\python3.7.8\Include\tesserocr'
cwd: C:\Users\admin\AppData\Local\Temp\pip-install-2wea8lhn\tesserocr_7c968dbcd0f74c6fb91abd8cd2f99d3a
Complete output (10 lines):
C:\Users\admin\AppData\Local\Temp\pip-install-2wea8lhn\tesserocr_7c968dbcd0f74c6fb91abd8cd2f99d3a\setup.py:135: DeprecationWarning: The 'warn' method is deprecated, use 'warning' instead
_LOGGER.warn('Failed to extract tesseract version from executable: {}'.format(e))
Failed to extract tesseract version from executable: [WinError 2] 系统找不到指定的文件。
Supporting tesseract v3.04.00
Building with configs: {'libraries': ['tesseract', 'lept'], 'cython_compile_time_env': {'TESSERACT_VERSION': 50593792}}
running install
running build
running build_ext
building 'tesserocr' extension
error: Microsoft Visual C++ 14.0 is required. Get it with "Build Tools for Visual Studio": https://visualstudio.microsoft.com/downloads/
----------------------------------------
ERROR: Command errored out with exit status 1: 'd:\python\python3.7.8\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\admin\AppData\Local\Temp\pip-install-2wea8lhn\tesserocr_7c968dbcd0f74c6fb91abd8cd2f99d3a\setup.py'"'"'; file='"'"'C:\Users\admin\AppData\Local\Temp\pip-install-2wea8lhn\tesserocr_7c968dbcd0f74c6fb91abd8cd2f99d3a\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(file) if os.path.exists(file) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record 'C:\Users\admin\AppData\Local\Temp\pip-record-04bmt0h5\install-record.txt' --single-version-externally-managed --compile --install-headers 'd:\python\python3.7.8\Include\tesserocr' Check the logs for full command output.

运行结果及报错内容
我的解答思路和尝试过的方法
我想要达到的结果
  • 写回答

2条回答 默认 最新

  • A Python 萌新花花 2022-01-05 11:07
    关注

    如果你已经下载了这个tesserocr的whl文件的话,你把他放到这个地方就好,然后再用pip install tesserocr

    img

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

问题事件

  • 系统已结题 1月13日
  • 已采纳回答 1月5日
  • 创建了问题 1月4日

悬赏问题

  • ¥35 平滑拟合曲线该如何生成
  • ¥100 c语言,请帮蒟蒻写一个题的范例作参考
  • ¥15 名为“Product”的列已属于此 DataTable
  • ¥15 安卓adb backup备份应用数据失败
  • ¥15 eclipse运行项目时遇到的问题
  • ¥15 关于#c##的问题:最近需要用CAT工具Trados进行一些开发
  • ¥15 南大pa1 小游戏没有界面,并且报了如下错误,尝试过换显卡驱动,但是好像不行
  • ¥15 自己瞎改改,结果现在又运行不了了
  • ¥15 链式存储应该如何解决
  • ¥15 没有证书,nginx怎么反向代理到只能接受https的公网网站