1

我正在尝试在 Windows10 主机操作系统上为 python 安装 tesserocr 包,但出现以下错误

 pip install tesserocr

执行

 pip install tesserocr
Collecting tesserocr
  Using cached tesserocr-2.1.3.tar.gz
Building wheels for collected packages: tesserocr
  Running setup.py bdist_wheel for tesserocr ... error
  Complete output from command "C:\Program Files\Anaconda3\python.exe" -u -c 
"import setuptools, 
tokenize;__file__='C:\\Users\\hp\\AppData\\Local\\Temp\\pip-build-
klj3zdup\\tesserocr\\setup.py';f=getattr(tokenize, 'open', open)
(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, 
__file__, 'exec'))" bdist_wheel -d 
C:\Users\hp\AppData\Local\Temp\tmpoyt9eh40pip-wheel- --python-tag cp35:
  running bdist_wheel
  running build
  running build_ext
  Failed to extract tesseract version from executable: [WinError 2] The 
system cannot find the file specified
  Supporting tesseract v3.04.00
  Building with configs: {'libraries': ['tesseract', 'lept'], 
'cython_compile_time_env': {'TESSERACT_VERSION': 197632}}
  cythoning tesserocr.pyx to tesserocr.cpp
  building 'tesserocr' extension
  error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft 
Visual C++ Build Tools": http://landinghub.visualstudio.com/visual-cpp-
build-tools

  ----------------------------------------
  Failed building wheel for tesserocr
  Running setup.py clean for tesserocr
Failed to build tesserocr
Installing collected packages: tesserocr
  Running setup.py install for tesserocr ... error
    Complete output from command "C:\Program Files\Anaconda3\python.exe" -u 
-c "import setuptools, 
tokenize;__file__='C:\\Users\\hp\\AppData\\Local\\Temp\\pip-build-
klj3zdup\\tesserocr\\setup.py';f=getattr(tokenize, 'open', open)
(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, 
__file__, 'exec'))" install --record C:\Users\hp\AppData\Local\Temp\pip-
10ema0ny-record\install-record.txt --single-version-externally-managed --
compile:
running install
running build
running build_ext
Failed to extract tesseract version from executable: [WinError 2] The system cannot find the file specified
Supporting tesseract v3.04.00
Building with configs: {'cython_compile_time_env': {'TESSERACT_VERSION': 197632}, 'libraries': ['tesseract', 'lept']}
skipping 'tesserocr.cpp' Cython extension (up-to-date)
building 'tesserocr' extension
error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": http://landinghub.visualstudio.com/visual-cpp-build-tools

----------------------------------------
Command ""C:\Program Files\Anaconda3\python.exe" -u -c "import setuptools, 
tokenize;__file__='C:\\Users\\hp\\AppData\\Local\\Temp\\pip-build-
klj3zdup\\tesserocr\\setup.py';f=getattr(tokenize, 'open', open)
(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, 
__file__, 'exec'))" install --record C:\Users\hp\AppData\Local\Temp\pip-
10ema0ny-record\install-record.txt --single-version-externally-managed --
compile" failed with error code 1 in C:\Users\hp\AppData\Local\Temp\pip-
build-klj3zdup\tesserocr\

如何克服这个问题?

4

2 回答 2

0

使用Anaconda直接重新加载 Python ,并使用:

conda install -c simonflueckiger tesserocr
于 2018-05-11T01:11:17.417 回答
0

从错误日志中可以看出,这里的问题是您的机器上缺少Microsoft Visual C++ 14.0.

要解决此问题,只需安装它,按照您在回溯中找到的链接(这个),然后使用命令重试

pip install tesserocr
于 2017-05-12T10:08:13.587 回答