PIL只能使用在Python2.x版本中,还没有支持Python3.x的版本

Python3.x 中安装不了PIL
由于PIL不支持Python3.x, 所以就有了pillow库,可以通过

pip3 install pillow

安装好pillow库之后,就可以跟安装好PIL库一样,导入PIL

from PIL import Image

测试代码:

import pytesseract
from PIL import Image

image = Image.open("./pip_test.png")
text = pytesseract.image_to_string(image)
print(text)

相关文章:

  • 2021-07-25
  • 2021-09-05
  • 2021-07-30
  • 2022-12-23
  • 2022-12-23
  • 2022-03-05
  • 2021-05-22
猜你喜欢
  • 2021-08-03
  • 2021-10-30
  • 2021-06-12
  • 2021-12-06
  • 2021-08-12
  • 2021-07-04
相关资源
相似解决方案