Mac M1 上的 Tesserocr 安装

时间:2021-03-11 04:51:00

标签: python macos tesseract leptonica

我尝试了很多,但仍然不知道为什么无法在 Mac M1 上安装 Tesserocrleptonicaerror 在这里,感谢您的帮助。

ERROR: Command errored out with exit status 1:
   command: /Users/mahdiseify/opt/anaconda3/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/yz/5nlp05fj4_555yk6l3wrwcrc0000gn/T/pip-install-g9egkz3i/tesseract-ocr/setup.py'"'"'; __file__='"'"'/private/var/folders/yz/5nlp05fj4_555yk6l3wrwcrc0000gn/T/pip-install-g9egkz3i/tesseract-ocr/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/yz/5nlp05fj4_555yk6l3wrwcrc0000gn/T/pip-wheel-698gyerl
       cwd: /private/var/folders/yz/5nlp05fj4_555yk6l3wrwcrc0000gn/T/pip-install-g9egkz3i/tesseract-ocr/
  Complete output (15 lines):
  running bdist_wheel
  running build
  running build_py
  file tesseract_ocr.py (for module tesseract_ocr) not found
  file tesseract_ocr.py (for module tesseract_ocr) not found
  running build_ext
  building 'tesseract_ocr' extension
  creating build
  creating build/temp.macosx-10.9-x86_64-3.8
  gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/mahdiseify/opt/anaconda3/include -arch x86_64 -I/Users/mahdiseify/opt/anaconda3/include -arch x86_64 -I/Users/mahdiseify/opt/anaconda3/include/python3.8 -c tesseract_ocr.cpp -o build/temp.macosx-10.9-x86_64-3.8/tesseract_ocr.o
  tesseract_ocr.cpp:643:10: fatal error: 'leptonica/allheaders.h' file not found
  #include "leptonica/allheaders.h"
           ^~~~~~~~~~~~~~~~~~~~~~~~
  1 error generated.
  error: command 'gcc' failed with exit status 1
  ----------------------------------------
  ERROR: Failed building wheel for tesseract-ocr

1 个答案:

答案 0 :(得分:0)

这看起来像leptonica相关的includes不在gcc的includes-path中。检查他们的位置,然后扩展 相应地 $C_INCLUDE_PATH。