maxenxe / HQ-Trivia-Bot-NOT-MAINTAINED-

Small NodeJS bot for HQ Trivia
24 stars 13 forks source link

Tesseract not recognised #7

Closed Darwin1119 closed 6 years ago

Darwin1119 commented 6 years ago

When I run the bot, I receive an error telling me tesseract is not a recognized command. Here is what command prompt gives me.

C:\Users\landw>node bot.js Screenshot done Answers resized node-tesseract: Running 'tesseract answers.jpg C:\Users\landw\AppData\Local\Temp\tmp-15148a3kNbjtP5mlX' node-tesseract: Preprocessor cleanup { Error: Command failed: tesseract answers.jpg C:\Users\landw\AppData\Local\Temp\tmp-15148a3kNbjtP5mlX 'tesseract' is not recognized as an internal or external command, operable program or batch file.

at ChildProcess.exithandler (child_process.js:275:12)
at emitTwo (events.js:126:13)
at ChildProcess.emit (events.js:214:7)
at maybeClose (internal/child_process.js:925:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)

killed: false, code: 1, signal: null, cmd: 'tesseract answers.jpg C:\Users\landw\AppData\Local\Temp\tmp-15148a3kNbjtP5mlX' }

maxenxe commented 6 years ago

Rereading the readme.md will probably fix your problem (updated it yesterday)

Darwin1119 commented 6 years ago

Still facing the same problem. What else could be the issue?

maxenxe commented 6 years ago

Tesseract should be recognized if it's in PATH, try restarting your PC maybe

Darwin1119 commented 6 years ago

I restarted my computer and it's still saying the same thing. I put tesseract in the user variables. is that the right one?

maxenxe commented 6 years ago

In your environment variables, you have normally the PATH variable, you must just add ;C:\Program Files (x86)\Tesseract-OCR;C:\Program Files (x86)\Tesseract-OCR\tessdata to it

Darwin1119 commented 6 years ago

just added it to there and I'm getting the same thing

maxenxe commented 6 years ago

Can you paste here your PATH ?

Darwin1119 commented 6 years ago

https://gyazo.com/411fad8511f05e1dc3bc945ee84df736

maxenxe commented 6 years ago

Putting them in 2 lines and removing the semicolon should do it

Darwin1119 commented 6 years ago

did that and the issue persists. Could I have installed it wrong somehow?

maxenxe commented 6 years ago

Did you relaunched your cmd ? Because you have to restart it everytime you change your Path It's weird, check if the directory added into Path exists and if they exists then check if tesseract.exe is in one of them

Darwin1119 commented 6 years ago

C:\Program Files (x86)>cd Tesseract-OCR The system cannot find the path specified.

maxenxe commented 6 years ago

Install this and retry https://github.com/tesseract-ocr/tesseract/wiki/4.0-with-LSTM#400-alpha-for-windows

Darwin1119 commented 6 years ago

Got it! thank you for your help!

Darwin1119 commented 6 years ago

I am now having an issue with the cropping of the screenshots, when it crops, it seems to read both the answers and the question for the question as well as read it all for the answers

maxenxe commented 6 years ago

https://github.com/maxenxe/HQ-Trivia-Bot/issues/6

maxenxe commented 6 years ago

Any news ?

Darwin1119 commented 6 years ago

It's working perfectly, but Google asks it to fill out a captcha or something after 15 ish requests

Darwin1119 commented 6 years ago

I just had to play with the cropping and adjust with trial and error but its working good

maxenxe commented 6 years ago

Nice !

beannguyen commented 6 years ago

Add C:\Program Files (x86)\Tesseract-OCR to PATH, and TESSDATA_PREFIX = C:\Program Files (x86)\Tesseract-OCR\tessdata

It's worked for me.