Giter VIP home page Giter VIP logo

Comments (11)

Delta0001 avatar Delta0001 commented on July 30, 2024 2

Currently getting the same error. Running on Python3 with Pillow.

edit: seems like directly changing line 60 of pytesseract.py to
tesseract_cmd = 'c:\\Program Files (x86)\\Tesseract-OCR\\tesseract'
solved the issue.

Source

from pytesseract.

madmaze avatar madmaze commented on July 30, 2024

Do you have tesseract-ocr installed and is the executable in your PATH environment variable?
if tesseract-ocr is not in your path, edit this: https://github.com/madmaze/pytesseract/blob/master/src/pytesseract.py#L60

In the future there should probably be a cmd line option to set the location of tesseract

from pytesseract.

tj-mueller avatar tj-mueller commented on July 30, 2024

I have a similar problem here, also using python 27 und Windows 7

The error reads as follows

Traceback (most recent call last):
File "C:\Users\Internet\Desktop\OCR-Projekt\OCR.py", line 30, in
print image_to_string(Image.open("C:\Users\Internet\Desktop\OCR-Projekt\im_name.png"))
File "C:\Program Files (x86)\Python27\lib\site-packages\pytesseract\pytesseract.py", line 161, in image_to_string
config=config)
File "C:\Program Files (x86)\Python27\lib\site-packages\pytesseract\pytesseract.py", line 94, in run_tesseract
stderr=subprocess.PIPE)
File "C:\Program Files (x86)\Python27\lib\subprocess.py", line 710, in init
errread, errwrite)
File "C:\Program Files (x86)\Python27\lib\subprocess.py", line 958, in _execute_child
startupinfo)
WindowsError: [Error 2]

tesseract 3.02.02 was installed with its original name and set in PATH. I am able to call it in cmd with and without administration rights.
Instead of the original PIL, pillow was installed

from pytesseract.

madmaze avatar madmaze commented on July 30, 2024

@tj-mueller could you try to give set tesseract_cmd to the full path of your tesseract binary and try it again?

from pytesseract.

tj-mueller avatar tj-mueller commented on July 30, 2024

@madmaze changing tesseract_cmd did not resolve the problem. Neither
C:\Program Files (x86)\Tesseract-OCR\tesseract.exe
nor
C:\Program Files (x86)\Tesseract-OCR
worked so far.

from pytesseract.

madmaze avatar madmaze commented on July 30, 2024

hmm i'll try to get my hands on some windows, but that might take a little while

from pytesseract.

omytea avatar omytea commented on July 30, 2024

@madmaze It is my fault that not giving the right path. Thanks for answering

from pytesseract.

aristotll avatar aristotll commented on July 30, 2024

I have the same problem

from pytesseract.

small-cold avatar small-cold commented on July 30, 2024

CMD window is worked normal, but pytesseract is failed.
Traceback (most recent call last): File "D:/PycharmProjects/CoreImage.py", line 79, in <module> text = image_to_string(image=image2, boxes=True) File "D:\mysoft\Python\Python35\lib\site-packages\pytesseract\pytesseract.py", line 161, in image_to_string config=config) File "D:\mysoft\Python\Python35\lib\site-packages\pytesseract\pytesseract.py", line 94, in run_tesseract stderr=subprocess.PIPE) File "D:\mysoft\Python\Python35\lib\subprocess.py", line 950, in __init__ restore_signals, start_new_session) File "D:\mysoft\Python\Python35\lib\subprocess.py", line 1220, in _execute_child startupinfo) FileNotFoundError: [WinError 2] 系统找不到指定的文件。

from pytesseract.

chrispwns avatar chrispwns commented on July 30, 2024

Chiming in to say this issue is happening to me as well. Windows 10 64-bit.

tesseract works in the command line like this:
tess

but, while I can open an image with PIL, the moment it's passed into pytesseract I get
FileNotFoundError: [Errno 2] No such file or directory: '/images/test-text.png'

from pytesseract.

bozhodimitrov avatar bozhodimitrov commented on July 30, 2024

Please use the appropriate tesseract 3.x or 4.x versions.
When you have errors with forward slashes on Windows, this means that your configuration is messed up or your tesseract version is not compiled correctly.

If you have any additional comments, please feel free to reopen the issue.

from pytesseract.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.