安裝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('\r\n', '\n');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('\r\n', '\n');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('\r\n', '\n');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/

報錯


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM