Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 5458

Python • Re: Need help for read numbers from a picture

$
0
0
Great, So simple and so effective, it works perfectly on the command line but I have a problem when doing it from a script, it tells me that the module does not exist.

Code:

import ssocrimport subprocessresult = subprocess.check_output("ssocr -d 3 make_mono invert test.jpg", shell=True, universal_newlines=True)print ( result )
result :

Code:

Traceback (most recent call last):  File "/home/pi/TEST-SSOCR.py", line 1, in <module>    import ssocrModuleNotFoundError: No module named 'ssocr'
any idea ?
Yes. The code you installed is for command line. It is not a python module so you don't need to import it as you are using the command line version with subprocess.

Take out the "import ssocr" line and it will work.

Statistics: Posted by rpdom — Sat Jul 20, 2024 10:57 am



Viewing all articles
Browse latest Browse all 5458

Trending Articles