Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes to source code to make it run on Linux + instructions #44

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

zoro11031
Copy link

There were some issues with the source code preventing it from compiling and running on Linux, made some minor changes to ocr_space.py and ocr.py and also added some instructions to ensure user has all required dependencies and can install the application to be easily launched

@@ -4,6 +4,7 @@
OCRSPACE_API_KEY = "" # Contact owner for developer key
OCRSPACE_API_URL_USA = "https://apipro1.ocr.space/parse/image"
OCRSPACE_API_URL_EU = "https://apipro2.ocr.space/parse/image"
tesseract_cmd = "/usr/bin/tesseract"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not an intended edit, correct?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey Matthew,
Full disclosure, I didn't write this code, my roommate did. I'm not a programmer, but I brought him in to help me figure this out because I recently switched to Linux and couldn't get game2text to compile (it's an important part of my studying routine, haha.)

This was intended, the original syntax was causing it to fail to compile on my system, and when he modified it and moved the tesseract line, it did compile.

This is what he had to say about it:

"Tesseract_cmd = “usr/bin/tesseract”

Was previously:

Pytesseract.pytesseract.tesseract_cmd = “usr/bin/tesseract”

And the interpreter was not understanding the variable. So I just called it ‘tesseract_cmd”

Also. This particular variable was being called to at the end of the script. In my experience it would need to be listed at the beginning of the script. So I moved its position. And the code compiled."

However, when I tried to reproduce the error just now for you on the original build, it compiled fine and launched. (I had the error saved, but we were up until about 4am troubleshooting this the other night and accidentally closed the doc I had it pasted the error into. Sorry about that.)

The issue must have been due to a problem with the dependencies or something? I will say for me pip install -r wasn't able to parse through the entire requirements.txt, and I had to go through line by line and pip install to ensure all the dependencies were installed.

Either way it looks like it still runs regardless of whether I try to compile the original version, or the modified version now. I'll continue to try to reproduce the original error.

@mathewthe2
Copy link
Owner

mathewthe2 commented Sep 5, 2022

Haven't run it on linux yet, but I suppose there is an issue with the space_ocr module on linux?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants