Mac 运行 Pytesseract 报错
【摘要】 Mac 运行 Pytesseract 报错Traceback (most recent call last): File "/Users/baojia/anaconda3/envs/py36/lib/python3.6/site-packages/pytesseract/pytesseract.py", line 184, in run_tesseract proc = subpro...
Mac 运行 Pytesseract 报错
Traceback (most recent call last): File "/Users/baojia/anaconda3/envs/py36/lib/python3.6/site-packages/pytesseract/pytesseract.py", line 184, in run_tesseract proc = subprocess.Popen(cmd_args, **subprocess_args()) File "/Users/baojia/anaconda3/envs/py36/lib/python3.6/subprocess.py", line 709, in __init__ restore_signals, start_new_session) File "/Users/baojia/anaconda3/envs/py36/lib/python3.6/subprocess.py", line 1344, in _execute_child raise child_exception_type(errno_num, err_msg, err_filename) FileNotFoundError: [Errno 2] No such file or directory: 'tesseract': 'tesseract' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/Users/baojia/Documents/Project/Old/行云管家/数据报表/main.py", line 55, in <module> login() File "/Users/baojia/Documents/Project/Old/行云管家/数据报表/main.py", line 28, in login optCode = pytesseract.image_to_string(image) File "/Users/baojia/anaconda3/envs/py36/lib/python3.6/site-packages/pytesseract/pytesseract.py", line 309, in image_to_string }[output_type]() File "/Users/baojia/anaconda3/envs/py36/lib/python3.6/site-packages/pytesseract/pytesseract.py", line 308, in <lambda> Output.STRING: lambda: run_and_get_output(*args), File "/Users/baojia/anaconda3/envs/py36/lib/python3.6/site-packages/pytesseract/pytesseract.py", line 218, in run_and_get_output run_tesseract(**kwargs) File "/Users/baojia/anaconda3/envs/py36/lib/python3.6/site-packages/pytesseract/pytesseract.py", line 186, in run_tesseract raise TesseractNotFoundError() pytesseract.pytesseract.TesseractNotFoundError: tesseract is not installed or it's not in your path Process finished with exit code 1
解决方法:Mac 使用 brew 安装 tesseract
(py36) MacBookPro:Project baojia$ brew install tesseract
(完)
【版权声明】本文为华为云社区用户原创内容,未经允许不得转载,如需转载请自行联系原作者进行授权。如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱:
cloudbbs@huaweicloud.com
- 点赞
- 收藏
- 关注作者
评论(0)