question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

OSError: [Errno 2] No such file or directory error

See original GitHub issue

The image seems to open, but then when I run image_to_string, it throws an exception:

>>> i = Image.open('test.png')
>>> print(pytesseract.image_to_string(i))
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python2.7/dist-packages/pytesseract/pytesseract.py", line 161, in image_to_string
    config=config)
  File "/usr/local/lib/python2.7/dist-packages/pytesseract/pytesseract.py", line 94, in run_tesseract
    stderr=subprocess.PIPE)
  File "/usr/lib/python2.7/subprocess.py", line 710, in __init__
    errread, errwrite)
  File "/usr/lib/python2.7/subprocess.py", line 1327, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
jiakechong1991commented, Sep 12, 2016

I am MAC,when have the program,I use “sudo brew install tesseract”,now I am OK,please try

0reactions
mattcanavancommented, Feb 9, 2017

Thank you for the tip @radzhome!

@madmaze do you think you could add their blurb to the README for those less savvy?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Python: OSError: [Errno 2] No such file or directory
I was compiling the android code v4.4 on Ubuntu 14.04, when I met the same problem of Python, no such file or directory....
Read more >
Python FileNotFoundError: [Errno 2] No such file or directory ...
The Python FileNotFoundError: [Errno 2] No such file or directory error is often raised by the os library. This error tells you that...
Read more >
Resolve OSError: [Errno 2] No Such File or Directory in Python
This OSError: [Errno 2] No such file or directory is generated by the OS library. This error happens when the file or directory...
Read more >
FileNotFoundError: [Errno 2] No such file or directory
In the above code, you are not giving the full path to a file to the open() function, just its name - a...
Read more >
[Solved] IOError errno 2 no such file or directory - Python Pool
The 'errorno 2 no such file or directory' is thrown when you are trying to access a file that is not present in...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found