DEV Community

Siddardha Annapureddy
Siddardha Annapureddy

Posted on

1 1

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

Heroku

Amplify your impact where it matters most — building exceptional apps.

Leave the infrastructure headaches to us, while you focus on pushing boundaries, realizing your vision, and making a lasting impression on your users.

Get Started

Top comments (0)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

👋 Kindness is contagious

DEV is better (more customized, reading settings like dark mode etc) when you're signed in!

Okay