使用image_to_string(image)时出现如下错误:
module ‘Image’ has no attribute ‘Image’
单独运行一下image_to_string函数发现如下问题:
打开pytesseract.py文件,找到如下语句:
try:
import Image
except ImportError:
from PIL import Image
将上述语句调换一下顺序:
try:
from PIL import Image
except ImportError:
import Image
或者直接from PIL import Image
直接使用PIL.Image。
module 'Image' has no attribute 'Image'
最新推荐文章于 2024-06-27 17:53:10 发布