运行Python的tesserocr和pillow模块来进行一次图片识别,但是图片这些都没问题,运行的时候也没出现网上所说的API问题,而是指出我的编码错误,但是编码错误又在tesserocr.pyx文件里面,不知道我是安装的时候出问题了还是哪一个环境出问题了
代码:
import tesserocr
from PIL import Image
image = Image.open('C:\\Users\李舜生\Desktop\python_workspace\\test_1.png')
print(tesserocr.image_to_text(image))
报错信息
C:\Users\李舜生\Desktop\python_workspace\venv\Scripts\python.exe C:/Users/李舜生/Desktop/python_workspace/install.py
Traceback (most recent call last):
File "C:/Users/李舜生/Desktop/python_workspace/install.py", line 1, in <module>
import tesserocr
File "C:\Users\李舜生\AppData\Roaming\Python\Python37\site-packages\tesserocr\__init__.py", line 1, in <module>
from ._tesserocr import *
File "tesserocr.pyx", line 52, in init tesserocr._tesserocr
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc0 in position 9: invalid start byte
Process finished with exit code 1
有哪位好心的大佬能指导一下么