Comments (11)
Currently getting the same error. Running on Python3 with Pillow.
edit: seems like directly changing line 60 of pytesseract.py to
tesseract_cmd = 'c:\\Program Files (x86)\\Tesseract-OCR\\tesseract'
solved the issue.
from pytesseract.
Do you have tesseract-ocr installed and is the executable in your PATH environment variable?
if tesseract-ocr is not in your path, edit this: https://github.com/madmaze/pytesseract/blob/master/src/pytesseract.py#L60
In the future there should probably be a cmd line option to set the location of tesseract
from pytesseract.
I have a similar problem here, also using python 27 und Windows 7
The error reads as follows
Traceback (most recent call last):
File "C:\Users\Internet\Desktop\OCR-Projekt\OCR.py", line 30, in
print image_to_string(Image.open("C:\Users\Internet\Desktop\OCR-Projekt\im_name.png"))
File "C:\Program Files (x86)\Python27\lib\site-packages\pytesseract\pytesseract.py", line 161, in image_to_string
config=config)
File "C:\Program Files (x86)\Python27\lib\site-packages\pytesseract\pytesseract.py", line 94, in run_tesseract
stderr=subprocess.PIPE)
File "C:\Program Files (x86)\Python27\lib\subprocess.py", line 710, in init
errread, errwrite)
File "C:\Program Files (x86)\Python27\lib\subprocess.py", line 958, in _execute_child
startupinfo)
WindowsError: [Error 2]
tesseract 3.02.02 was installed with its original name and set in PATH. I am able to call it in cmd with and without administration rights.
Instead of the original PIL, pillow was installed
from pytesseract.
@tj-mueller could you try to give set tesseract_cmd to the full path of your tesseract binary and try it again?
from pytesseract.
@madmaze changing tesseract_cmd did not resolve the problem. Neither
C:\Program Files (x86)\Tesseract-OCR\tesseract.exe
nor
C:\Program Files (x86)\Tesseract-OCR
worked so far.
from pytesseract.
hmm i'll try to get my hands on some windows, but that might take a little while
from pytesseract.
@madmaze It is my fault that not giving the right path. Thanks for answering
from pytesseract.
I have the same problem
from pytesseract.
CMD window is worked normal, but pytesseract is failed.
Traceback (most recent call last): File "D:/PycharmProjects/CoreImage.py", line 79, in <module> text = image_to_string(image=image2, boxes=True) File "D:\mysoft\Python\Python35\lib\site-packages\pytesseract\pytesseract.py", line 161, in image_to_string config=config) File "D:\mysoft\Python\Python35\lib\site-packages\pytesseract\pytesseract.py", line 94, in run_tesseract stderr=subprocess.PIPE) File "D:\mysoft\Python\Python35\lib\subprocess.py", line 950, in __init__ restore_signals, start_new_session) File "D:\mysoft\Python\Python35\lib\subprocess.py", line 1220, in _execute_child startupinfo) FileNotFoundError: [WinError 2] 系统找不到指定的文件。
from pytesseract.
Chiming in to say this issue is happening to me as well. Windows 10 64-bit.
tesseract works in the command line like this:
but, while I can open an image with PIL, the moment it's passed into pytesseract I get
FileNotFoundError: [Errno 2] No such file or directory: '/images/test-text.png'
from pytesseract.
Please use the appropriate tesseract 3.x or 4.x versions.
When you have errors with forward slashes on Windows, this means that your configuration is messed up or your tesseract version is not compiled correctly.
If you have any additional comments, please feel free to reopen the issue.
from pytesseract.
Related Issues (20)
- Tox fails for Python 3.11 HOT 1
- output_type=pytesseract.Output.STRING still provides bytes object HOT 2
- Tesserract.exe stopped working when trying to run OCR HOT 2
- Boxes of images (within text) HOT 2
- Spaces and Dots HOT 1
- newline character in data frame output
- ModuleNotFoundError: No module named 'pytesseract' HOT 6
- Orientated text detection HOT 1
- pytesseract's openMP runtime conflicts with CLIP HOT 6
- Python 3.11.4 changes the output of image_to_data HOT 4
- Can't pass citation mark character into tessedit_char_whitelist HOT 2
- Update PyPI package to pytesseract v0.3.13 HOT 4
- [Feature Request] Wrapper around training HOT 3
- image_to_data default output type is string HOT 2
- Deprecation warning raised in python 3.12 HOT 1
- Unsupported image object when using numpy.ndarray image HOT 2
- I think you need to improve character recognition by using and implementing ChatGPT in OCR HOT 3
- FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\guess\\AppData\\Local\\Temp\\tess_gtrqc8za.hocr' HOT 3
- Tesseract OCR Language Data Configuration Error in Python Environment HOT 4
- PyTesseract cannot read my number HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pytesseract.