mertemur / gartic.io-bot

drawing the picture of the given words
1 stars 2 forks source link

error #1

Closed myygunduz closed 3 years ago

myygunduz commented 3 years ago

I am getting TesseractNotFoundError error full error:

Traceback (most recent call last):
  File "C:\Users\user\AppData\Local\Programs\Python\Python38-32\lib\site-packages\pytesseract\pytesseract.py", line 252, in run_tesseract
    proc = subprocess.Popen(cmd_args, **subprocess_args())
  File "C:\Users\user\AppData\Local\Programs\Python\Python38-32\lib\subprocess.py", line 854, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "C:\Users\user\AppData\Local\Programs\Python\Python38-32\lib\subprocess.py", line 1307, 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 "C:\Users\user\Downloads\gartic.io-bot-main\gartic.io-bot-main\gartic.py", line 19, in <module>
    word = pytesseract.image_to_string(frame)
  File "C:\Users\user\AppData\Local\Programs\Python\Python38-32\lib\site-packages\pytesseract\pytesseract.py", line 413, in image_to_string
    return {
  File "C:\Users\user\AppData\Local\Programs\Python\Python38-32\lib\site-packages\pytesseract\pytesseract.py", line 416, in <lambda>
    Output.STRING: lambda: run_and_get_output(*args),
  File "C:\Users\user\AppData\Local\Programs\Python\Python38-32\lib\site-packages\pytesseract\pytesseract.py", line 284, in run_and_get_output
    run_tesseract(**kwargs)
  File "C:\Users\user\AppData\Local\Programs\Python\Python38-32\lib\site-packages\pytesseract\pytesseract.py", line 256, in run_tesseract
    raise TesseractNotFoundError()
pytesseract.pytesseract.TesseractNotFoundError: D:\Applications\tes\tesseract.exe is not installed or it's not in your PATH. See README file for more information.
mertemur commented 3 years ago

Actually, it's my fault that not explaining which packages you should download and how to use them. Your problem is about "missing 'tesseract' executable". First, you should download the tesseract setup from https://digi.bib.uni-mannheim.de/tesseract/ I'd recommend the latest stable version (which is v5.0 for now). You can also visit a GitHub project about tesseract to learn how to use it properly. ex.: https://github.com/CreepyD246/Simple-Text-Detection-Using-Python ) After installing the package, you need to copy the exact path of the tesseract.exe. Then you can paste it after pytesseract.tesseract_cmd ( line13 for now) with double \ Another point is that you need to download chromedriver.exe and do the same process(line 45 for now) I'll create "how-to-use" and "dependences" sections as soon as possible. Again, sorry about that...