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' –
兄弟倆都給出了這個錯誤我以前曾試過兩種解決方案。我被困在做什麼 –