DEV Community ๐Ÿ‘ฉโ€๐Ÿ’ป๐Ÿ‘จโ€๐Ÿ’ป

Siddardha Annapureddy
Siddardha Annapureddy

Posted on

tesseract not working in the spyder

i am getting an error when i use the python tesseract in spyder. i have installed the tesseract engine and install the pytesseract package too.
i am getting the below error

TesseractNotFoundError: C:\ProgramFiles\Tesseract-OCR\tesseract.exe is not installed or it's not in your PATH. See README file for more information.
i have set the tesseract folder path in system environmental variables too.
please help me i am struck
the below information is the console shown error

runfile('C:/Users/Siddardha/.spyder-py3/python_using_pytesseract.py', wdir='C:/Users/Siddardha/.spyder-py3')
Traceback (most recent call last):

  File ~\AppData\Roaming\Python\Python39\site-packages\pytesseract\pytesseract.py:254 in run_tesseract
    proc = subprocess.Popen(cmd_args, **subprocess_args())

  File C:\ProgramData\Anaconda3\lib\site-packages\spyder_kernels\customize\spydercustomize.py:108 in __init__
    super(SubprocessPopen, self).__init__(*args, **kwargs)

  File C:\ProgramData\Anaconda3\lib\subprocess.py:951 in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,

  File C:\ProgramData\Anaconda3\lib\subprocess.py:1420 in _execute_child
    hp, ht, pid, tid = _winapi.CreateProcess(executable, args,

FileNotFoundError: [WinError 2] The system cannot find the file specified


During handling of the above exception, another exception occurred:

Traceback (most recent call last):

  File ~\.spyder-py3\python_using_pytesseract.py:22 in <module>
    texts = pytesseract.image_to_string(img)

  File ~\AppData\Roaming\Python\Python39\site-packages\pytesseract\pytesseract.py:416 in image_to_string
    return {

  File ~\AppData\Roaming\Python\Python39\site-packages\pytesseract\pytesseract.py:419 in <lambda>
    Output.STRING: lambda: run_and_get_output(*args),

  File ~\AppData\Roaming\Python\Python39\site-packages\pytesseract\pytesseract.py:286 in run_and_get_output
    run_tesseract(**kwargs)

  File ~\AppData\Roaming\Python\Python39\site-packages\pytesseract\pytesseract.py:258 in run_tesseract
    raise TesseractNotFoundError()

TesseractNotFoundError: C:\ProgramFiles\Tesseract-OCR\tesseract.exe is not installed or it's not in your PATH. See README file for more information.


Enter fullscreen mode Exit fullscreen mode

Top comments (0)

๐ŸŒš Browsing with dark mode makes you a better developer by a factor of exactly 40.

It's a scientific fact.