Python 3.x 未能为Tesseract v4-MacOS安装tesserocr

Python 3.x 未能为Tesseract v4-MacOS安装tesserocr,python-3.x,macos,tesseract,macos-mojave,Python 3.x,Macos,Tesseract,Macos Mojave,我正在尝试pip安装,但遇到以下错误。 我尝试了几种不同的方法在其文档上安装Suggestive,但都没有效果 在这一点上,我确信这个问题与这个软件包无关(因为我的朋友在他的Mac上安装了它,没有任何问题,我也安装了Ubuntu VM w/o问题)。 错误似乎是C++库,因为它无法找到标题或在TestSerACT OCR的源代码(?)中,但是在它成功找到错误行之前。p> 我还安装了pytesseract,但没有问题 我希望这里有人能帮助调试导致此问题的原因 我的tesseract(通过brew安

我正在尝试pip安装,但遇到以下错误。 我尝试了几种不同的方法在其文档上安装Suggestive,但都没有效果

在这一点上,我确信这个问题与这个软件包无关(因为我的朋友在他的Mac上安装了它,没有任何问题,我也安装了Ubuntu VM w/o问题)。 错误似乎是C++库,因为它无法找到标题或在TestSerACT OCR的源代码(?)中,但是在它成功找到错误行之前。p> 我还安装了pytesseract,但没有问题

我希望这里有人能帮助调试导致此问题的原因

我的tesseract(通过brew安装)版本为:
tesseract 4.0.0
瘦素A-1.76.0
libjpeg 9c:libpng 1.6.35:libtiff 4.0.9:zlib 1.2.11

谢谢,让我知道你可能需要的其他信息

  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/charlieyou/miniconda3/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/2h/ty244jbd1vd3d1l0m4k3_g980000gn/T/pip-install-wgh41bv0/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/2h/ty244jbd1vd3d1l0m4k3_g980000gn/T/pip-record-0grp17wc/install-record.txt --single-version-externally-managed --compile:
    pkg-config failed to find tesseract/lept libraries: b"Package tesseract was not found in the pkg-config search path.\nPerhaps you should add the directory containing `tesseract.pc'\nto the PKG_CONFIG_PATH environment variable\nNo package 'tesseract' found\n"
    Supporting tesseract v4.0.0
    Building with configs: {'libraries': ['tesseract', 'lept'], 'cython_compile_time_env': {'TESSERACT_VERSION': 262144}}
    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/charlieyou/miniconda3/include -arch x86_64 -I/Users/charlieyou/miniconda3/include -arch x86_64 -I/usr/local/include -I/Users/charlieyou/miniconda3/include/python3.6m -c tesserocr.cpp -o build/temp.macosx-10.7-x86_64-3.6/tesserocr.o -std=c++11 -DUSE_STD_NAMESPACE
    warning: include path for stdlibc++ headers not found; pass '-std=libc++' on the command line to use the libc++ standard library instead [-Wstdlibcxx-not-found]
    In file included from tesserocr.cpp:603:
    **/usr/local/include/tesseract/unichar.h:24:10: fatal error: 'cstring' file not found
    #include <cstring>**
             ^~~~~~~~~
    1 warning and 1 error generated.
    error: command 'gcc' failed with exit status 1
为tesserocr构建控制盘失败
为tesserocr运行setup.py clean
未能生成tesserocr
安装收集的软件包:tesserocr
正在为tesserocr运行setup.py安装。。。错误
从命令/Users/charlieyou/miniconda3/bin/python-u-c“import setuptools,tokenize;uuu file uuu='/private/var/folders/2h/ty244jbd1vd3d1l0m4k3 g98000gn/T/pip-install-wgh41bv0/tesserocr/setup.py';f=getattr(tokenize,'open',打开)(uu文件);code=f.read().替换('\r\n','n');f.close();exec(编译(代码,u文件),'exec')”安装--record/private/var/folders/2h/ty244jbd1vd3d1l0m4k3_g98000gn/T/pip-record-0grp17wc/install-record.txt--外部管理的单一版本--编译:
pkg config未能找到tesseract/lept库:b“在pkg config搜索路径中找不到包tesseract。\n或者您应该将包含“tesseract.pc”的目录\n添加到pkg\u config\u path环境变量中\n未找到包“tesseract”\n
支持tesseract v4.0.0
使用以下配置生成:{'libraries':['tesseract','lept'],'cython_compile_time_env':{'tesseract_VERSION':262144}
正在运行的安装
运行构建
运行build_ext
建筑“tesserocr”扩建
创建构建
创建构建/临时macosx-10.7-x86_64-3.6
gcc-Wno未使用的结果-Wsign比较-Wunreachable代码-DNDEBUG-g-fwrapv-O3-Wall-Wstrict原型-I/Users/charlieyou/miniconda3/include-arch x86_64-I/Users/miniconda3/include-arch x86_64-I/usr/local/include-I/Users/charlieyou/miniconda3/include/python3.6m-c tesserocr.cpp-o build/temp.macosx-10.7-x86_64-3.6/tesserocr.o-std=c++11-DUSE_std_名称空间
警告:未找到stdlibc++头的包含路径;在命令行上传递'-std=libc++',以使用libc++标准库[-Wstdlibcxx未找到]
在tesserocr.cpp:603中包含的文件中:
**/usr/local/include/tesseract/unichar.h:24:10:致命错误:未找到“cstring”文件
#包括**
^~~~~~~~~
生成1个警告和1个错误。
错误:命令“gcc”失败,退出状态为1

您可以尝试:xcode选择--安装

我也无法安装,我的错误消息是:
错误:命令'/usr/bin/clang'失败,退出状态为1

我的mac上也有同样的问题

您应该尝试使用conda安装程序包:


conda install-c mcs07 tesserocrI已经安装了:)您还应该发布有关特定错误的更多详细信息。这篇文章并不是真正试图回答这个问题。请注意,这是一个问答网站,每个帖子都是一个问题或问题的答案。帖子也可以有这样的小句子,可以用来批评或要求作者澄清。这应该是一个注释或一个注释