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

2018-03-14 20:00:22 +08:00
 lusuon

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 上有人提出了同样的问题,但仍没有回答。

8884 次点击
所在节点    Python
5 条回复
ZoomQuiet
2018-03-15 07:21:46 +08:00
是也乎 ╮(╯▽╰)╭

一般 windows 的问题…
可用安装虚拟机…
到 Linux 环境中自然解决…
Gakho
2018-03-16 13:35:33 +08:00
我当时也是这样,好像后面是找了 exe 还是 msi 来安装的,因为之前还有一个 cxOracle 也是在 WIndows 下有这种问题
hixiaoyin
2018-06-06 18:34:45 +08:00
楼主,按你的方法解决了
但现在有个问题:我用 2018 版的 pycharm,它自带 venv,因此产生了隔离的 python 环境
Anaconda 的那些库是装在系统 python 中的,有没有什么办法可以让 pycharm 产生的隔离环境也能用 tesserocr 呢?
Cheney1911
2018-06-16 21:26:04 +08:00
按楼主的方式解决了,但是不知道是什么原因
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:

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/438072

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX