from PIL import Image
from pytesser import *
image_file = 'E:\Downloads\menu.tiff'
im = Image.open(image_file)
text = image_to_string(im)
text = image_file_to_string(image_file)
text = image_file_to_string(image_file, graceful_errors=True)
print ("=====output=======\n")
print (text)
看到错误显示找不到模块,但util文件在tesseract自身的目录中。我不知道为什么它的发生显示未找到它。 当试图导入的模块已经存在时,模块丢失
我的问题是非常简单的内部初始化的.py如何导入util.py和errors.py
------------------------------------------------- -------------------------- ImportError Traceback(最近呼叫的最后一个) in () 1从进口PIL图像 ----> 2从进口pytesser * 4 IMAGE_FILE = 'E:\下载\ menu.tiff' 5 IM = Image.open(IMAGE_FILE) C:\用户\ SACHIN \ Anaconda3 \ lib \ site-packages \ pytesser \ __ init__.py () 7导入子进程 ----> 9 from。 import utils 10 from。导入错误 –
11 tesseract_exe_name ='C:\\ Users \\ SACHIN \\ Anaconda3 \\ Lib \\ site-packages \\ pytesser \\ tesseract'#要在命令行调用的可执行文件的名称 ImportError:无法导入名称'utils' –
兄弟俩都给出了这个错误我以前曾试过两种解决方案。我被困在做什么 –