刚开始装我先装的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.