gpt4 book ai didi

python-3.x - 无法为 Tesseract v4 安装 tesserocr - MacOS

转载 作者:行者123 更新时间:2023-12-05 08:07:47 27 4
gpt4 key购买 nike

我正在尝试 pip 安装 tesserocr但遇到以下错误。我尝试了几种不同的方法来安装其文档中建议的方法,但都无济于事。

此时我确定问题与此软件包无关(因为我的 friend 将它安装在他的 Mac 上没有问题,我也安装在没有问题的 Ubuntu VM 上)。错误似乎是 c++ 库,因为它找不到 header 或 Tesseract-OCR 的源代码(?),但是在它成功找到错误行之前。

我也安装了 pytesseract 没有问题。

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

我的 tesseract(通过 brew 安装)版本是:tesseract 4.0.0
leptonica-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

最佳答案

我在我的 mac 上遇到了同样的问题,

您应该尝试使用 conda 安装软件包:

conda 安装-c mcs07 tesserocr

关于python-3.x - 无法为 Tesseract v4 安装 tesserocr - MacOS,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53401490/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com