简体   繁体   中英

How to install tesseract for python on anaconda

Does anyone know how to install tesseract for python on Anaconda? I have a windows system. The anaconda website gives the installation for a linux system:

conda install -c auto pytesseract 

Would there be any alterations required for a windows system?

🚀 Working Solution (👨‍🔬 tested at Jun 2019)

  • 🕵️‍♂️ I have searched it on anaconda cloud
  • 🌟 Most downloaded version (for win64) install command:
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:

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:

conda install -c conda-forge tesseract

To import it via pytesseract you will have to install pytesseract as well:

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)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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