博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
解决Mac安装tesserocr报错问题 Failed building wheel for
阅读量:4476 次
发布时间:2019-06-08

本文共 5483 字,大约阅读时间需要 18 分钟。

localhost:~ jerry$ Processing /var/www/git/python/tesserocr

-bash: Processing: command not found

localhost:~ jerry$ pip3 install tesserocr

Collecting tesserocr

  Using cached https://files.pythonhosted.org/packages/f8/6d/4e81e041f33a4419e59edcb1dbdf3c56e9393f60f5ef531381bd67a1339b/tesserocr-2.3.1.tar.gz

Building wheels for collected packages: tesserocr

  Running setup.py bdist_wheel for tesserocr ... error

  Complete output from command /anaconda3/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/b_/dgk5x9dx6bx69rhw7v6dhgtw0000gn/T/pip-install-v4ek5yfd/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/b_/dgk5x9dx6bx69rhw7v6dhgtw0000gn/T/pip-wheel-u4i9uj2o --python-tag cp37:

  /private/var/folders/b_/dgk5x9dx6bx69rhw7v6dhgtw0000gn/T/pip-install-v4ek5yfd/tesserocr/setup.py:132: DeprecationWarning: The 'warn' method is deprecated, use 'warning' instead

    _LOGGER.warn('pkg-config failed to find tesseract/lept libraries: {}'.format(e))

  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 bdist_wheel

  running build

  running build_ext

  building 'tesserocr' extension

  creating build

  creating build/temp.macosx-10.7-x86_64-3.7

  gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/anaconda3/include -arch x86_64 -I/anaconda3/include -arch x86_64 -I/anaconda3/include/python3.7m -c tesserocr.cpp -o build/temp.macosx-10.7-x86_64-3.7/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

  

  ----------------------------------------

  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 /anaconda3/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/b_/dgk5x9dx6bx69rhw7v6dhgtw0000gn/T/pip-install-v4ek5yfd/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/b_/dgk5x9dx6bx69rhw7v6dhgtw0000gn/T/pip-record-1cw_w_lk/install-record.txt --single-version-externally-managed --compile:

    /private/var/folders/b_/dgk5x9dx6bx69rhw7v6dhgtw0000gn/T/pip-install-v4ek5yfd/tesserocr/setup.py:132: DeprecationWarning: The 'warn' method is deprecated, use 'warning' instead

      _LOGGER.warn('pkg-config failed to find tesseract/lept libraries: {}'.format(e))

    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.7

    gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/anaconda3/include -arch x86_64 -I/anaconda3/include -arch x86_64 -I/anaconda3/include/python3.7m -c tesserocr.cpp -o build/temp.macosx-10.7-x86_64-3.7/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

    

    ----------------------------------------

Command "/anaconda3/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/b_/dgk5x9dx6bx69rhw7v6dhgtw0000gn/T/pip-install-v4ek5yfd/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/b_/dgk5x9dx6bx69rhw7v6dhgtw0000gn/T/pip-record-1cw_w_lk/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/b_/dgk5x9dx6bx69rhw7v6dhgtw0000gn/T/pip-install-v4ek5yfd/tesserocr/

 

看了下网上的搜索结果,发现原来是我安装了Anaconda的原因。同时,也找到了解决方法

conda install -c simonflueckiger tesserocr

查了下conda install 发现conda是针对于python的。可以安装minconda或anaconda进行安装。所以在安装了Anaconda的条件下,我们可以通过conda install安装tesserocr

 

参考链接地址:http://mkd.pub/chl434723646/415732_22875257.html

转载于:https://www.cnblogs.com/jerryspace/p/9887255.html

你可能感兴趣的文章
Docker 安装及问题处理
查看>>
JavaScript中的call 和apply的用途以及区别
查看>>
HashMap完全解读
查看>>
匿名内部类
查看>>
man命令重定向后有^H乱码问题
查看>>
自定义popupwindow(解决位置控制困惑)
查看>>
BZOJ4071: [APIO2015]八邻旁之桥
查看>>
Redis的六种特性 场景
查看>>
mysql 添加[取消]timestamp的自动更新
查看>>
码农的半衰期只有15年?
查看>>
手工释放linux内存
查看>>
2014-5-30 总结
查看>>
【H3 BPM工作流程管理产品小故事】第四篇 子表创建
查看>>
洛谷P1148 拱猪计分
查看>>
MySQL服务器的安装和配置,MySQL Workbench 8.0.12安装,MySQL的基本使用
查看>>
扑克序列
查看>>
java笔记--适配器模式的运用
查看>>
C#与数据结构--图的遍历
查看>>
ispy 编译笔记
查看>>
bzoj1067——SCOI2007降雨量(线段树,细节题)
查看>>