安装tesserocr错误(未解决)

Posted chengchengaqin

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了安装tesserocr错误(未解决)相关的知识,希望对你有一定的参考价值。

在 Mac下,我们首先使用 Homebrew安装 ImageMagick和 tesseract库 :

brew install imagemagick
brew install tesseract --all-languages

接下来再安装 tesserocr即可:

pip3 install tesserocr pillow

Collecting tesserocr
  Using cached https://files.pythonhosted.org/packages/f8/6d/4e81e041f33a4419e59edcb1dbdf3c56e9393f60f5ef531381bd67a1339b/tesserocr-2.3.1.tar.gz
Requirement already satisfied: pillow in ./anaconda3/lib/python3.6/site-packages (5.1.0)
Building wheels for collected packages: tesserocr
  Running setup.py bdist_wheel for tesserocr ... error
  Complete output from command /Users/zhengcheng/anaconda3/bin/python -u -c "import setuptools, tokenize;__file__=‘/private/var/folders/dm/_lrrz5tx14l7bl9qcgcbb8hh0000gn/T/pip-install-y4ggr5um/tesserocr/setup.py‘;f=getattr(tokenize, ‘open‘, open)(__file__);code=f.read().replace(‘
‘, ‘
‘);f.close();exec(compile(code, __file__, ‘exec‘))" bdist_wheel -d /private/var/folders/dm/_lrrz5tx14l7bl9qcgcbb8hh0000gn/T/pip-wheel-hz580ef_ --python-tag cp36:
  Supporting tesseract v3.05.02
  Building with configs: {libraries: [tesseract, lept], cython_compile_time_env: {TESSERACT_VERSION: 197890}}
  /Users/zhengcheng/anaconda3/lib/python3.6/distutils/dist.py:261: UserWarning: Unknown distribution option: long_description_content_type
    warnings.warn(msg)
  running bdist_wheel
  running build
  running build_ext
  building tesserocr extension
  creating build
  creating build/temp.macosx-10.7-x86_64-3.6
  gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/zhengcheng/anaconda3/include -arch x86_64 -I/Users/zhengcheng/anaconda3/include -arch x86_64 -I/Users/zhengcheng/anaconda3/include/python3.6m -c tesserocr.cpp -o build/temp.macosx-10.7-x86_64-3.6/tesserocr.o -std=c++11 -DUSE_STD_NAMESPACE
  In file included from tesserocr.cpp:603:
  In file included from /usr/local/include/tesseract/genericvector.h:27:
  In file included from /usr/local/include/tesseract/tesscallback.h:22:
  /usr/local/include/tesseract/host.h:28:10: fatal error: cstdint file not found
  #include <cstdint>      // int32_t, ...
           ^~~~~~~~~
  1 error generated.
  error: command gcc failed with exit status 1
  
  ----------------------------------------
  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 /Users/zhengcheng/anaconda3/bin/python -u -c "import setuptools, tokenize;__file__=‘/private/var/folders/dm/_lrrz5tx14l7bl9qcgcbb8hh0000gn/T/pip-install-y4ggr5um/tesserocr/setup.py‘;f=getattr(tokenize, ‘open‘, open)(__file__);code=f.read().replace(‘
‘, ‘
‘);f.close();exec(compile(code, __file__, ‘exec‘))" install --record /private/var/folders/dm/_lrrz5tx14l7bl9qcgcbb8hh0000gn/T/pip-record-beutjg17/install-record.txt --single-version-externally-managed --compile:
    Supporting tesseract v3.05.02
    Building with configs: {libraries: [tesseract, lept], cython_compile_time_env: {TESSERACT_VERSION: 197890}}
    /Users/zhengcheng/anaconda3/lib/python3.6/distutils/dist.py:261: UserWarning: Unknown distribution option: long_description_content_type
      warnings.warn(msg)
    running install
    running build
    running build_ext
    building tesserocr extension
    creating build
    creating build/temp.macosx-10.7-x86_64-3.6
    gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/zhengcheng/anaconda3/include -arch x86_64 -I/Users/zhengcheng/anaconda3/include -arch x86_64 -I/Users/zhengcheng/anaconda3/include/python3.6m -c tesserocr.cpp -o build/temp.macosx-10.7-x86_64-3.6/tesserocr.o -std=c++11 -DUSE_STD_NAMESPACE
    In file included from tesserocr.cpp:603:
    In file included from /usr/local/include/tesseract/genericvector.h:27:
    In file included from /usr/local/include/tesseract/tesscallback.h:22:
    /usr/local/include/tesseract/host.h:28:10: fatal error: cstdint file not found
    #include <cstdint>      // int32_t, ...
             ^~~~~~~~~
    1 error generated.
    error: command gcc failed with exit status 1
    
    ----------------------------------------
Command "/Users/zhengcheng/anaconda3/bin/python -u -c "import setuptools, tokenize;__file__=/private/var/folders/dm/_lrrz5tx14l7bl9qcgcbb8hh0000gn/T/pip-install-y4ggr5um/tesserocr/setup.py;f=getattr(tokenize, open, open)(__file__);code=f.read().replace(
, 
);f.close();exec(compile(code, __file__, exec))" install --record /private/var/folders/dm/_lrrz5tx14l7bl9qcgcbb8hh0000gn/T/pip-record-beutjg17/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/dm/_lrrz5tx14l7bl9qcgcbb8hh0000gn/T/pip-install-y4ggr5um/tesserocr/

报错


以上是关于安装tesserocr错误(未解决)的主要内容,如果未能解决你的问题,请参考以下文章

Python安装tesserocr遇到的各种问题及解决办法

解决 tesserocr 无法安装问题!

win10下pip3安装tesserocr时报错

解决Mac安装tesserocr报错问题 Failed building wheel for

尝试安装 tesserocr 时出错

由于未找到 ID 错误的视图,列表片段未出现