python - 如何解决 Tesseract Not Found Error,Anaconda?
问题描述
所以我的 conda 版本是 4.8.3 我是新安装的 tesseract 和 anaconda。使用以下命令安装 tesseract:
`conda install -c conda-forge pytesseract`
`conda install -c conda-forge/label/cf202003 pytesseract `
现在,当我尝试将简单图像运行到 ocr 代码时,出现以下错误
File "C:\Users\user\Anaconda3\lib\site-packages\pytesseract\pytesseract.py", line 232, in
run_tesseract 提高TesseractNotFoundError()
TesseractNotFoundError: tesseract is not installed or it's not in your path
解决方案
您会看到此错误,因为您的PATH中没有 tesseract 可执行文件。所以你必须包括以下行:
pytesseract.pytesseract.tesseract_cmd = r'C:\\Program Files\\Tesseract-OCR\\tesseract.exe'
您可以在pytesseract的官方文档中看到一个示例。
我编写了默认的tesseract 可执行文件夹,但如果您更改了它,请记住使用<full_path_to_your_tesseract_executable>
(如上一个链接中所建议的)。
推荐阅读
- google-sheets - 如何在 Google 表格的过滤器匹配公式中动态获取单元格值?
- reactjs - Tailwind 断点不适用于 Next.js SSG
- python - 如何处理这些数据集以创建 datasetDict?
- python - AttributeError:“列表”对象没有属性“data_filter”
- android - 不同productFlavors的Android替代xml资源文件
- powershell - 在移动文件之前寻求Powershell函数来检查多个文件夹是否存在
- c - 如何使用函数返回初始化结构成员?
- r - 是否有用于计算 df 中每一行的 Spearman 相关系数并将其写为向量的 R 函数?
- css - 如何使用scss根据下拉文本大小动态更改宽度
- visual-studio - Glat 库文件未在 Visual Studio 中运行