pytesseract-そのようなファイルまたはディレクトリはありませんエラー 質問する

pytesseract-そのようなファイルまたはディレクトリはありませんエラー 質問する

私はUbuntu 14.04を使用しています。次のコードがあります:

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

しかし、次のエラーが引き続き発生します。

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.7/dist-packages/spyderlib/widgets/externalshell/sitecustomize.py", line 540, in runfile
    execfile(filename, namespace)
  File "/home/chaitanya/pythonapp/localcopy.py", line 4, in <module>
    print pytesseract.image_to_string(im)
  File "/usr/local/lib/python2.7/dist-packages/pytesseract/pytesseract.py", line 142, in image_to_string
    config=config)
  File "/usr/local/lib/python2.7/dist-packages/pytesseract/pytesseract.py", line 75, in run_tesseract
    stderr=subprocess.PIPE)
  File "/usr/lib/python2.7/subprocess.py", line 710, in __init__
    errread, errwrite)
  File "/usr/lib/python2.7/subprocess.py", line 1327, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory

Python プログラムとイメージは両方とも同じ場所にあります。何が問題なのでしょうか?

ベストアンサー1

インストールする必要があるものtesseract-ocr:

sudo apt-get install tesseract-ocr

おすすめ記事