सबसे पहले मैं यहाँ सब कुछ फिर भी उल्लेख किया था कि pytesseract-no such file or directory errorPytesseract ऐसा कोई फ़ाइल या निर्देशिका त्रुटि
काम नहीं करता। अब मैं Pycharm आईडीई उपयोग कर रहा हूँ निम्न कोड के साथ:
from PIL import Image
import pytesseract
import subprocess
im = Image.open('test.png')
im.show()
subprocess.call(['tesseract','test.png','out'])
print pytesseract.image_to_string(Image.open('test.png'))
- im.show() छवि सफलतापूर्वक खोलता है।
- subprocess.call() Tesseract भी बाहर test.png के साथ छवि से पाठ निकालता है ..
- लेकिन pytesseract.image_to_string() विफल रहता है।
मुझे यह नहीं मिला। मैं शैल में टेस्सेक्ट का उपयोग क्यों कर सकता हूं लेकिन पायथन में नहीं। और अजगर में मैं एक ही छवि खोल सकता हूं लेकिन जब टेस्सेक्ट के साथ प्रयोग किया जाता है तो छवि नहीं मिल सकती है।
नीचे आप त्रुटि आउटपुट देख सकते हैं।
File "/home/hamza-c/Schreibtisch/Android/JioShare/orc.py", line 7, in <module>
print pytesseract.image_to_string(Image.open('/home/hamza-c/Schreibtisch/Android/JioShare/test.png'))
File "/usr/local/lib/python2.7/dist-packages/pytesseract/pytesseract.py", line 162, in image_to_string
config=config)
File "/usr/local/lib/python2.7/dist-packages/pytesseract/pytesseract.py", line 95, in run_tesseract
stderr=subprocess.PIPE)
File "/usr/lib/python2.7/subprocess.py", line 711, in __init__
errread, errwrite)
File "/usr/lib/python2.7/subprocess.py", line 1340, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory
मुझे एक ही समस्या थी और समाधान मिला [यहां] (https://stackoverflow.com/questions/28741563/pytesseract-no-such-file-or-directory-error) –