安装tesseract后如何重置系统变量PATH [英] How to reset System Variable PATH after tesseract installation

查看:151
本文介绍了安装tesseract后如何重置系统变量PATH的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从

I downloaded and installed tesseract-ocr-setup-3.05.00dev.exe from https://github.com/UB-Mannheim/tesseract/wiki and ticked the Add to Path and Set TESSDATA_PREFIX variable upon installation.

过去,我的系统路径由很多东西组成,包括Python,Node,Npm等.现在,它只是Tesseract的一个项目(见图片)

It used to be that my System Path consisted of many things including Python, Node, Npm, etc. Now, it is just a single item of Tesseract (see image)

如何获取系统路径变量?

How can I get back my System Path Variables?

推荐答案

从Tesseract 3.05.00开始,删除了添加到路径"复选框,因为它引起了问题. UB-Mannhaim文档:

Starting from Tesseract 3.05.00 the Add to Path checkbox was removed, as it caused problems. UB-Mannhaim documentation:

旧版本的安装程序可以选择将Tesseract添加到 PATH环境变量.默认情况下禁用该选项.如果它 已启用且PATH太长,可能会发生新PATH 是空的.我们建议不要使用该选项,并在我们的中将其禁用 最新版本.

Old versions of the installer had an option to add Tesseract to the PATH environment variable. That option was disabled by default. If it was enabled and PATH was very long, it could happen that the new PATH was empty. We suggest not to use that option and disabled it in our latest version.

遵循UB-Mannhaim的建议,而不是向系统变量添加PATH,您始终可以考虑在代码中设置局部变量.

Following the UB-Mannhaim recommendation, instead of adding PATH to system variables you can always consider setting a local variable in your code.

pytesseract文档中的示例:

# If you don't have tesseract executable in your PATH, include the following:
pytesseract.pytesseract.tesseract_cmd = r'<full_path_to_your_tesseract_executable>'
# Example tesseract_cmd = r'C:\Program Files (x86)\Tesseract-OCR\tesseract'

pyocr :

pyocr.tesseract.TESSERACT_CMD = r'<full_path_to_your_tesseract_executable>'

这篇关于安装tesseract后如何重置系统变量PATH的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆