微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

Mac M1 上的 Tesserocr 安装

如何解决Mac M1 上的 Tesserocr 安装

我尝试了很多,但仍然不知道为什么无法在 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

解决方法

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

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。