使用image_to_string(image)时出现如下错误:
module 'Image' has no attribute 'Image'
module ‘Image’ has no attribute ‘Image’
单独运行一下image_to_string函数发现如下问题:
module 'Image' has no attribute 'Image'
打开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。

相关文章:

  • 2021-09-28
  • 2021-08-28
  • 2022-12-23
  • 2022-12-23
  • 2021-09-26
  • 2021-09-15
  • 2021-12-19
  • 2021-11-02
猜你喜欢
  • 2022-01-06
  • 2021-12-24
  • 2021-10-07
  • 2021-12-31
  • 2021-09-19
  • 2021-10-20
  • 2021-05-23
相关资源
相似解决方案