Please make sure the TESSDATA_PREFIX environment variable is set to your "tessdata" direct

Posted 愤怒的企鹅

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Please make sure the TESSDATA_PREFIX environment variable is set to your "tessdata" direct相关的知识,希望对你有一定的参考价值。

tesseract的一个操作问题,简单记录 类似坑尽量少猜

运行 .\tesseract.exe .\1356445914_9857.jpg tstimg  
报错如下:
Please make sure the TESSDATA_PREFIX environment variable is set to your "tessdata" directory.
Failed loading language ‘eng‘
Tesseract couldn‘t load any languages!
Could not initialize tesseract.

环境变量未设置,那就找到对应的tessdata文件夹设置就行了呗

将 TESSDATA_PREFIX 设置为 E:\src-test\tesseract_all\tessdata

关闭控制台,重开一个控制台。-- 下一个控制台 环境变量才生效

还是不行,郁闷一会。将tessdata拷贝到tesseract.exe 所在目录生效。  可是为啥直接设置环境变量不生效呢?
原来是tesseract寻找的是TESSDATA_PREFIX 所指向包含 tessdata的目录。   所以应该设成 tessdata 上层的目录,即:E:\src-test\tesseract_all


而且 “TESSDATA_PREFIX”这个变量本身命名上也提示了 “PREFIX”  tessdata的上层目录。 看来设计者已经考虑到类似这个问题的存在了啊。

以上是关于Please make sure the TESSDATA_PREFIX environment variable is set to your "tessdata" direct的主要内容,如果未能解决你的问题,请参考以下文章

[Git]Please make sure you have the correct access rights and the repository exists

git:Please make sure you have the correct access rights and the repository exists.问题解决

Git Please make sure you have the correct access rights and the repository exists.

出现Please make sure you have the correct access rights and the repository exists.问题解决

出现Please make sure you have the correct access rights and the repository exists.问题解决

:app:compileDebugKotlin Supertypes of the following classes cannot be resolved. Please make sure you