如何在 Windows 上安装 tesserocr? [英] How to install tesserocr on windows?
问题描述
我下载了tesseract-OCR的可执行文件并安装了它.另一方面,我还从 http://www.leptonica.com/download 下载了 leptonica 的 zip 文件.html.它包括两个目录,分别是lib
和include
.
I downloaded executable file of tesseract-OCR and installed it. On the other hand, I also downloaded a zipfile of leptonica from http://www.leptonica.com/download.html. It includes two directory that is lib
and include
.
接下来我尝试在 python 虚拟环境中执行 pip install tesserocr
并返回错误
Next I tried to do pip install tesserocr
in a python virtualenvironment and it returned error
tesserocr.cpp(460) : fatal error C1083: Cannot open include file: 'leptonica/allheaders.h': No such file or directory
我注意到 allheaders.h
位于我之前下载的 leptonica 文件的 include
目录中.我该如何解决这个问题?我应该把我从 leptonica 得到的目录 include
和 lib
放在哪里来完成这项工作?
I noticed that allheaders.h
is in include
directory from the leptonica file I downloaded earlier. How do I solve this? Where should I put the directory include
and lib
I got from leptonica to make this work?
是否有其他方法可以在 Windows 计算机上安装 tesseract-ocr
并正确使用 tesseract-ocr
?目前我正在使用 Windows 10 运行我的 python 脚本,该脚本使用 tesseract-ocr 来识别图像上的某些字符.我也打算以后在windows 7电脑上运行这个脚本.
Is there any other way to install tesseract-ocr
and use tesserocr
properly on windows computer? Currently I am using Windows 10 to run my python script that use tesseract-ocr to recognize some character on image. I also plan to run the script on windows 7 computer later.
感谢您的帮助.
推荐答案
使用 Anaconda 在名为 OCR
Use Anaconda to install TesserOCR
in an environment named OCR
- 从此处 安装适用于 Windows 的 Anaconda
打开 Anaconda 提示:
- Install Anaconda for Windows from here
Open Anaconda Prompt:
conda create -n OCR python=3.6
激活 OCR
对于tesseract 3.5.1(稳定版):
For tesseract 3.5.1 (stable):
conda install -c simonflueckiger tesserocr
OR 用于 tesseract 4.0.0(实验性):
OR for tesseract 4.0.0 (experimental):
conda install -c simonflueckiger/label/tesseract-4.0.0-master tesserocr
OR 从 在这里并通过以下方式安装:
OR download the wheel file matching your Windows platform and Python installation from here and install it via:
pip install
这篇关于如何在 Windows 上安装 tesserocr?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!