我已经pytesseract使用安装了该库
pip install pytesseract\nRun Code Online (Sandbox Code Playgroud)\n\n当我尝试使用该image_to_text方法时,它给了我一个
\n\n\nFileNotFoundError: [WinError 2] 系统找不到指定的文件
\n
我用谷歌搜索了一下,发现我应该更改 pytesseract.py 文件和行中的某些内容
\n\ntesseract_cmd = \'tesseract\'\nRun Code Online (Sandbox Code Playgroud)\n\n应该成为
\n\ntesseract_cmd = path_to_folder_that_contains_tesseractEXE + \'tesseract\' \nRun Code Online (Sandbox Code Playgroud)\n\n我搜索并没有tesseract.exe在我的 Python 文件夹中找到任何文件,然后我重新安装了该库,但该文件仍然不存在。最后,我将该行替换为:
tesseract_cmd = path_to_folder_that_contains_pytesseractEXE + \'pytesseract\'\nRun Code Online (Sandbox Code Playgroud)\n\n我的程序抛出:
\n\n\n\n\npytesseract.pytesseract.TesseractError: (2, \'用法: python pytesseract.py [-l lang] input_file\')
\n
我该怎么做才能让我的程序正常运行?
\n\nPS这是我的程序代码:
\n\nfrom pytesseract import image_to_string\nfrom PIL import Image, ImageEnhance, ImageFilter\n\nim = Image.open(r\'C:\\Users\\\xd0\xa4\xd0\xb8\xd0\xbb\xd0\xb8\xd0\xbf\xd0\xbf\\Desktop\\ImageToText_Python\\NoName.png\') \nprint(im)\n\ntxt = image_to_string(im)\nprint(txt)\nRun Code Online (Sandbox Code Playgroud)\n\n … 目前正在使用pyTelegramBotAPI编写我的第一个机器人。我想禁用某些消息的链接预览。我该怎么做呢?