ubuntu的python中tesseract报错没能安装或不在路径中

具体执行结果为: /usr/bin/python2.7 /home/taoyujie/下载/pycharm-community-2021.1/plugins/python-ce/helpers/pydev/pydevd.py --multiproc --qt-support=auto --client 127.0.0.1 --port 45153 --file /home/taoyujie/PycharmProjects/pythonProject/shibie.py

Connected to pydev debugger (build 211.6693.115)

Traceback (most recent call last):

File "/home/taoyujie/下载/pycharm-community-2021.1/plugins/python-ce/helpers/pydev/pydevd.py", line 1483, in _exec pydev_imports.execfile(file, globals, locals) # execute the script

File "/home/taoyujie/PycharmProjects/pythonProject/shibie.py", line 5, in import pytesseract

File "/usr/local/lib/python2.7/dist-packages/pytesseract/init.py", line 2, in from .pytesseract import ALTONotSupported

SyntaxError: ('invalid syntax', ('/usr/local/lib/python2.7/dist-packages/pytesseract/pytesseract.py', 89, 73, '
f"{tesseract_cmd} is not installed or it's not in your PATH."\n'))

Process finished with exit code 1

已经尝试了在pytesseract.py文件中代码修改为which tesseract显示的路径:tesseract_cmd = '/usr/bin/tesseract'

不知道你这个问题是否已经解决, 如果还没有解决的话:

如果你已经解决了该问题, 非常希望你能够分享一下解决方案, 以帮助更多的人 ^-^