PremissionError: [Errno 13] Permission denied
See original GitHub issueI am using OSx with python 3.6
Here is my code:
try:
import Image
except:
from PIL import Image
import pytesseract
pytesseract.pytesseract.tesseract_cmd = '/usr/local/Cellar/tesseract/3.05.01/'
import cv2
img = cv2.imread('case_2.png')
img = Image.fromarray(img)
print(pytesseract.image_to_string(img, lang='chi_sim'))
But it outputted an error:
Traceback (most recent call last):
File "/Users/Dylan/Documents/GitHub/Genedock/ocr_framework/tempfyllslkgxc.py", line 13, in <module>
print(pytesseract.image_to_string(Image.open('case_2.png'), lang='chi_sim'))
File "/Users/Dylan/anaconda/lib/python3.6/site-packages/pytesseract/pytesseract.py", line 122, in image_to_string
config=config)
File "/Users/Dylan/anaconda/lib/python3.6/site-packages/pytesseract/pytesseract.py", line 46, in run_tesseract
proc = subprocess.Popen(command, stderr=subprocess.PIPE)
File "/Users/Dylan/anaconda/lib/python3.6/subprocess.py", line 707, in __init__
restore_signals, start_new_session)
File "/Users/Dylan/anaconda/lib/python3.6/subprocess.py", line 1326, in _execute_child
raise child_exception_type(errno_num, err_msg)
PermissionError: [Errno 13] Permission denied
I search all of the StackOverflow, but in vain.
So hope you can help me as soon as possible.
Issue Analytics
- State:
- Created 6 years ago
- Comments:12
Top Results From Across the Web
PermissionError: [Errno 13] Permission denied - Stack Overflow
This happens if you are trying to open a file, but your path is a folder. This can happen easily by mistake. To...
Read more >PermissionError: [Errno 13] Permission denied error solved
The error "PermissionError: [Errno 13] Permission denied error" often occurs when the file you are trying to read from or write to is...
Read more >Python PermissionError: [errno 13] permission denied Solution
The PermissionError: [errno 13] permission denied error occurs when you try to access a file from Python without having the necessary ...
Read more >Fix - PermissionError: [Errno 13] Permission denied in Python
The python error “PermissionError: [Errno 13] Permission denied” can be fixed in various ways after knowing the root cause.
Read more >PermissionError: [Errno 13] Permission denied: 'C:\\my\\path ...
You tried to move or replace a file which is open in another application. This is very common in PyInstaller if you open...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Your error is on this line:
pytesseract.pytesseract.tesseract_cmd = '/usr/local/Cellar/tesseract/3.05.01/'
You should point the tesseract_cmd to the exact path of the tesseract executable and not to the path of the folder where the tesseract executable is located, which is what you did.
Try this line instead:
pytesseract.pytesseract.tesseract_cmd = '/usr/local/Cellar/tesseract/3.05.01/tesseract'
Also be sure that you have the tesseract executable inside the folder.
@diyali03 You can try to issue the following command in order to locate the path of tesseract:
which tesseract