简体   繁体   English

如何在anaconda上为python安装tesseract

[英]How to install tesseract for python on anaconda

Does anyone know how to install tesseract for python on Anaconda?有谁知道如何在 Anaconda 上为 python 安装 tesseract? I have a windows system.我有一个windows系统。 The anaconda website gives the installation for a linux system: anaconda 网站提供了 linux 系统的安装:

conda install -c auto pytesseract 

Would there be any alterations required for a windows system? Windows 系统是否需要进行任何更改?

🚀 Working Solution (👨‍🔬 tested at Jun 2019) 🚀 工作解决方案(👨‍🔬 于 2019 年 6 月测试)

  • 🕵️‍♂️ I have searched it on anaconda cloud 🕵️‍♂️我已经在anaconda cloud上搜索过了
  • 🌟 Most downloaded version (for win64) install command: 🌟 下载次数最多的版本(win64)安装命令:
conda install -c mcs07 tesseract
conda install -c jim-hart pytesseract

刚刚尝试进行 pip install ,它似乎奏效了!

pip install pytesseract 

To install this package with conda on Windows run one of the following:要在 Windows 上使用 conda 安装此软件包,请运行以下操作之一:

conda install -c simonflueckiger tesserocr 
conda install -c simonflueckiger/label/tesseract-4.0.0-master tesserocr 
conda install -c simonflueckiger/label/tesseract-3.5.1 tesserocr

For those who want to install tesseract on MacBook/OSX, use conda-forge channel:对于那些想在 MacBook/OSX 上安装 tesseract 的人,请使用 conda-forge 频道:

conda install -c conda-forge tesseract

To import it via pytesseract you will have to install pytesseract as well:要通过 pytesseract 导入它,您还必须安装 pytesseract:

conda install -c conda-forge pytesseract

And use it like:并像这样使用它:

import pytesseract
import cv2 # For loading image

img = cv2.imread('read_my_doc_image.jpg')
text = pytesseract.image_to_string(
    img, config='-l eng --oem 1 --psm 6'
)
print(text)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM