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

can't import tesserocr #160

Closed
yuwan1994 opened this issue Nov 19, 2018 · 7 comments
Closed

can't import tesserocr #160

yuwan1994 opened this issue Nov 19, 2018 · 7 comments

Comments

@yuwan1994
Copy link

yuwan1994 commented Nov 19, 2018

already installed tesserocr ,but can not find the tesserocr
2018-11-18 1 30 15
2018-11-18 1 30 55

system:Mac OS 10.12.6
Python:3.6.6
tesseract:4.0.0
tesserocr:2.3.1

@xiejun946
Copy link

please show import error

@yuwan1994
Copy link
Author

please show import error

if import tesserocr , then run the program, show:!strcmp(locale, "C"):Error:Assert failed:in file baseapi.cpp, line 209

@xiejun946
Copy link

!strcmp(locale, "C"):Error:Assert failed:in file baseapi.cpp, line 209
/var/folders/1v/r0pq3sh92kjdz3qqnybcpg4r0000gp/T/geany_run_script_HTLITZ.sh: line 7: 91100 Illegal instruction: 4 python3 "chrometest.py"

i am the same error with you ,but i found it work well in python2.7

@abhishek-jain-infrrd
Copy link

Pycharm latest version seemed to have the issue where even after installing it wasn't able to import tesserocr. So I downgraded my Pycharm to the version 2018.1.6 and the import error for tesserocr got fixed.

If locale error then it can be fixed by either importing export LC_ALL=C in terminal or setting it in the python file where you are using tesserocr as locale.setlocale(locale.LC_ALL, 'C') or if still getting error in Pycharm IDE then just set LC_ALL=C as Environment variable in the run configuration for that file.

@kimgysen
Copy link

kimgysen commented Feb 26, 2019

I have the same problem using the official installation instructions. Been trying to fix the error:

ModuleNotFoundError: No module named 'tesserocr'

For hours.
Issue is open since december last year.
If this can't be resolved, then this is library is pretty much useless...
Not going to spend hours in other people's mess.

@neuneck
Copy link

neuneck commented Feb 7, 2020

I can corroborate that on python3.7.5, with tesserocr version 2.5.0 a segfault appears on import if the locale has not been set to "C".

@sirfz
Copy link
Owner

sirfz commented Feb 8, 2020

The locale issue has been addressed already and was related to tesseract itself and not tesserocr. It's already been fixed in tesseract 4.1 (see #165)

@sirfz sirfz closed this as completed Feb 8, 2020
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

No branches or pull requests

6 participants