pytesseract-no such file or directory error

前端 未结 3 1167
一个人的身影
一个人的身影 2020-12-05 23:18

I am using Ubuntu 14.04. I have the following code:

import Image
import pytesseract
im = Image.open(\'test.png\')
print pytesseract.image_to_string(im)


        
相关标签:
3条回答
  • 2020-12-06 00:00

    You need to install tesseract-ocr:

    sudo apt-get install tesseract-ocr
    
    0 讨论(0)
  • 2020-12-06 00:14

    If you're on windows and have PIP installed go to your project directory and run:

    pip install tesseract-ocr

    0 讨论(0)
  • 2020-12-06 00:19

    Based off of @padraic cunningham's answer which I tailored to my setting.

    If you are on Linux (ubuntu 16, should not matter) and have a conda installation:

    First search for what you need to be installing:

    $ anaconda search -t conda tesserocr
    

    You will get a few options, you need to look at the platforms and builds to identify what makes sense for you.

    As I have python 3.6 and linux-64 I chose mcs07/tesserocr

    To install:

    $ conda install -c mcs07 tesserocr
    

    That's it. I didn't need a restart of the terminal or anything. I just kept going.

    0 讨论(0)
提交回复
热议问题