[Python-Dev] Need help in OCR implementation with Python3.5.1 or pyCharm Community edition

Ryan Gonzalez rymg19 at gmail.com
Thu May 5 11:26:47 EDT 2016


On Thu, May 5, 2016 at 3:24 AM, Deepak Srivastava <d.srivastava15 at gmail.com>
wrote:

>
> Dear All,
>
> I am new to python and very much excited to learn this technology.
>
> I have done setup of python 3.5.1 with PyCharm community edition on
> windows 7(64bit service pack 1).
>
> I am trying to execute some piece of code but it fails . Requesting you to
> please help.
>
>
>
> My Piece of code is
>
> *import *pytesseract
> *from *PIL *import *Image
> *from *PIL *import *ImageFilter
> *import *os
> print (os.getcwd())
> url=
> *"Polish.png"**def *process_image(*url*):
>     image = _get_image(*url*)
>     image = image.filter(ImageFilter.SHARPEN)
> #    image = image.convert('1')
>     print (pytesseract.image_to_string(image))
>
> *def *_get_image(*url*):
>     *return *Image.open(*url*)
>
> process_image(url)
>
>
>
> Error which I am getting ,
>
> *C:\Users\Administrator\AppData\Local\Programs\Python\Python35-32\python.exe
> C:/Temp/Opt/src/ocr.py*
>
> *C:\Temp\Opt\src*
>
> *in subprocess*
>
> *None*
>
> *0*
>
> *None*
>
> *None*
>
> *<subprocess.STARTUPINFO object at 0x02EA4BF0>*
>
> *Traceback (most recent call last):*
>
> *  File "C:/Temp/Opt/src/ocr.py", line 17, in <module>*
>
> *    process_image(url)*
>
> *  File "C:/Temp/Opt/src/ocr.py", line 12, in process_image*
>
> *    print (pytesseract.image_to_string(image))*
>
> *  File
> "C:\Users\Administrator\AppData\Roaming\Python\Python35\site-packages\pytesseract\pytesseract.py",
> line 161, in image_to_string*
>
> *    config=config)*
>
> *  File
> "C:\Users\Administrator\AppData\Roaming\Python\Python35\site-packages\pytesseract\pytesseract.py",
> line 94, in run_tesseract*
>
> *    stderr=subprocess.PIPE)*
>
> *  File
> "C:\Users\Administrator\AppData\Local\Programs\Python\Python35-32\lib\subprocess.py",
> line 950, in __init__*
>
> *    restore_signals, start_new_session)*
>
> *  File
> "C:\Users\Administrator\AppData\Local\Programs\Python\Python35-32\lib\subprocess.py",
> line 1226, in _execute_child*
>
> *    startupinfo)*
>
> *FileNotFoundError: [WinError 2] The system cannot find the file specified*
>
>
>
> *Process finished with exit code 1*
>
>
>
> Thanks and Regards
>
> Deepak Srivastava
>
>
>
>
Questions like this are better suited for python-list. Regardless, you need
to install Tesseract first:

https://github.com/tesseract-ocr/tesseract/wiki

That should fix the error.


>
> _______________________________________________
> Python-Dev mailing list
> Python-Dev at python.org
> https://mail.python.org/mailman/listinfo/python-dev
> Unsubscribe:
> https://mail.python.org/mailman/options/python-dev/rymg19%40gmail.com
>
>


-- 
Ryan
[ERROR]: Your autotools build scripts are 200 lines longer than your
program. Something’s wrong.
http://kirbyfan64.github.io/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20160505/47ed053c/attachment-0001.html>


More information about the Python-Dev mailing list