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" directory.的更多相关文章

  1. pytesseract.pytesseract.TesseractError: (1, 'Error opening data file /usr/local/share/tessdata/chi_sim.traineddata Please make sure the TESSDATA_PREFIX environment variable is set to your "tessdata"

    pytesseract.pytesseract.TesseractError: (1, 'Error opening data file /usr/local/share/tessdata/chi_s ...

  2. 【已解决】mac上appium报错:“Could not find aapt Please set the ANDROID_HOME environment variable with the Android SDK root directory path”

    按照网上教程配置完appium环境后,真机跑自动化过程,遇到如下报错: appium报错如下: [ADB] Checking whether aapt is present [ADB] The AND ...

  3. Could not find aapt Please set the ANDROID_HOME environment variable with the Android SDK root directory path

    写case写好好哒,突然debug的时候就冒出这个错误: selenium.common.exceptions.WebDriverException: Message: An unknown serv ...

  4. Appium问题解决方案(7)- Could not find 'adb.exe' in PATH. Please set the ANDROID_HOME environment variable with the Android SDK root directory path

    背景:运行代码提示找不到ADB An unknown server-side error occurred while processing the command. Original error: ...

  5. tesseract-ocr 出现 错误 Please make sure the TESSDATA_PREFIX environment variable is set to the parent d irectory of your "tessdata" directory.解决方案

    简单就是说把tessdata拷贝到exe的所在目录,或者设置TESSDATA_PREFIX环境变量

  6. TOMCAT-报错The BASEDIR environment variable is not defined correctly

    <span style="font-size:18px;">The BASEDIR environment variable is not defined correc ...

  7. myeclipse使用maven插件进行maven install时报错check $m2_home environment variable and mvn script match

    check $m2_home environment variable and mvn script match 分类: maven2015-09-01 18:06 842人阅读 评论(0) 收藏 举 ...

  8. 教新手一步步解决:Plugin is too old, please update to a more recent version, or set ANDROID_DAILY_OVERRIDE environment variable to和更新gradle问题

    android studio出现问题:Plugin is too old, please update to a more recent version, or set ANDROID_DAILY_O ...

  9. -Dmaven.multiModuleProjectDirectory system propery is not set. Check $M2_HOME environment variable and mvn script match.

    一, eclipse中使用maven插件的时候,运行run as maven build的时候报错 -Dmaven.multiModuleProjectDirectory system propery ...

随机推荐

  1. wpf ComboBox设置默认值

    最新的wpf的ComboBox设置默认值得方法是,给VM中的数据集合第一个元素插入一个提示项目,比如:请选择一项,然后通过数据绑定可以实现默认选中第一项,下面我就贴一下示例代码: xaml页面: &l ...

  2. Asp.net控制Tomcat启动关闭的实现方法

    一.场景 近日有个项目客户要求能自己配置相关权限.由于历史原因这个项目采用的是公司以前的权限系统.这个权限系统很强大,不过有个弊端,就是每增加一个权限菜单都要重启才能生效,不然就要等1天它缓存过期后才 ...

  3. Tweened Animations 渐变动作

    Tweened Animations 渐变动作 Animations分两类: 第一类:渐变的(Tweened): 淡入淡出(Alpha),旋转(Rotate),移动(Translate),缩放(Sca ...

  4. C# 各版本的新特性

    http://www.cnblogs.com/JeffreySun/archive/2012/11/14/2770211.html

  5. iOS-更新CocoaPods出现错误 提示重复文件

    当多人开发的时候,或者引入了一些别人的第三方库文件的时候,当我们再更新CocoaPods时会出现错误,错误提示有一些文件 出现重复,这个时候我们需要查看一些是什么文件出现了重复,错误提示是xxxx三方 ...

  6. 一起学 Java集合框架、数据结构、泛型

    一.Java 集合框架 集合框架是一个用来代表和操纵集合的统一架构.所有的集合框架都包含如下内容: 接口:是代表集合的抽象数据类型.接口允许集合独立操纵其代表的细节.在面向对象的语言,接口通常形成一个 ...

  7. 9.JavaScript简单计算器的实现

    1.难点,怎么获取标签的值,注意点,获取到的值都是string类型,还要转换 var num1 = parseInt(document.getElementById("num1") ...

  8. Qt 如何自动安装常用依赖?

    使用 *.prf 文件自动安装依赖 在 Qt\Qt5.9.5\5.9.5\msvc2015\mkspecs\features 路径中添加 auto_install.prf 文件 然后在程序配置文件(* ...

  9. jmeter断言之BeanShell断言

    1.添加BeanShell断言,在Script下面写断言脚本,常用的BeanShell脚本如下: if(!SampleResult.getResponseCode().equals("200 ...

  10. rest_framake之视图

    开始,先放大招 一  最原始的写法 前戏之序列化 class AuthorSerializer(serializers.ModelSerializer): class Meta: model = mo ...