V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
lusuon
V2EX  ›  Python

请教一下如何正确地安装 tesserocr

  •  1
     
  •   lusuon · 2018-03-14 20:00:22 +08:00 · 8879 次点击
    这是一个创建于 2234 天前的主题,其中的信息可能已经有所发展或是发生改变。

    win10,直接使用 pip install tesserocr 的命令,输出如下:

    tesserocr.cpp(596): fatal error C1083: 无法打开包括文件: “ leptonica/allheaders.h ”: No such file or directory error: command 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe' failed with exit status 2

    似乎是 leptonica 库的问题,现在我已经从源码编译出了 dll,那么接下来该怎么办? StackOverflow 上有人提出了同样的问题,但仍没有回答。

    第 1 条附言  ·  2018-03-18 10:03:31 +08:00
    最后直接用 Anaconda 重装 python,使用 conda install -c simonflueckiger tesserocr 解决了
    5 条回复    2018-09-28 15:39:53 +08:00
    ZoomQuiet
        1
    ZoomQuiet  
       2018-03-15 07:21:46 +08:00 via iPhone
    是也乎 ╮(╯▽╰)╭

    一般 windows 的问题…
    可用安装虚拟机…
    到 Linux 环境中自然解决…
    Gakho
        2
    Gakho  
       2018-03-16 13:35:33 +08:00
    我当时也是这样,好像后面是找了 exe 还是 msi 来安装的,因为之前还有一个 cxOracle 也是在 WIndows 下有这种问题
    hixiaoyin
        3
    hixiaoyin  
       2018-06-06 18:34:45 +08:00
    楼主,按你的方法解决了
    但现在有个问题:我用 2018 版的 pycharm,它自带 venv,因此产生了隔离的 python 环境
    Anaconda 的那些库是装在系统 python 中的,有没有什么办法可以让 pycharm 产生的隔离环境也能用 tesserocr 呢?
    Cheney1911
        4
    Cheney1911  
       2018-06-16 21:26:04 +08:00
    按楼主的方式解决了,但是不知道是什么原因
    helloworld1204
        5
    helloworld1204  
       2018-09-28 15:39:53 +08:00
    Windows
    The proposed downloads consist of stand-alone packages containing all the Windows libraries needed for execution. This means that no additional installation of tesseract is required on your system.

    Conda
    You can use the channel simonflueckiger to install from Conda:

    > conda install -c simonflueckiger tesserocr
    or to get tesserocr compiled with tesseract 4.0.0:

    > conda install -c simonflueckiger/label/tesseract-4.0.0-master tesserocr
    pip
    Download the wheel file corresponding to your Windows platform and Python installation from simonflueckiger/tesserocr-windows_build/releases and install them via:

    > pip install <package_name>.whl
    Usage
    Initialize and re-use the tesseract API instance to score multiple images:
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   980 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 21:06 · PVG 05:06 · LAX 14:06 · JFK 17:06
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.