gpt4 book ai didi

python - 无法在阿里巴巴 EC 实例 (Ubuntu 20.04.2) 中为 python 3.8.10 安装 pytesseract

转载 作者:行者123 更新时间:2023-12-04 18:28:49 27 4
gpt4 key购买 nike

环境:
阿里弹性计算实例
操作系统 Ubuntu 20.04.2 LTS(GNU/Linux 5.4.0-77-generic x86_64)
python 3.8.10
我无法按照以下命令安装。pip install pytesseract也用过pip3 install pytesseract我收到以下错误。

Looking in indexes: http://mirrors.cloud.aliyuncs.com/pypi/simple/
Collecting pytesseract
Downloading http://mirrors.cloud.aliyuncs.com/pypi/packages/a3/c9/d6e8903482bd6fb994c32722831d15842dd8b614f94ad9ca735807252671/pytesseract-0.3.8.tar.gz (14 kB)
ERROR: Command errored out with exit status 1:
command: /usr/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-9ia5l4ys/pytesseract/setup.py'"'"'; __file__='"'"'/tmp/pip-install-9ia5l4ys/pytesseract/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-install-9ia5l4ys/pytesseract/pip-egg-info
cwd: /tmp/pip-install-9ia5l4ys/pytesseract/
Complete output (42 lines):
Traceback (most recent call last):
File "/tmp/pip-install-9ia5l4ys/pytesseract/pytesseract/pytesseract.py", line 26, in <module>
from PIL import Image
ModuleNotFoundError: No module named 'PIL'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-install-9ia5l4ys/pytesseract/setup.py", line 4, in <module>
setup()
File "/usr/lib/python3/dist-packages/setuptools/__init__.py", line 144, in setup
return distutils.core.setup(**attrs)
File "/usr/lib/python3.8/distutils/core.py", line 121, in setup
dist.parse_config_files()
File "/usr/lib/python3/dist-packages/setuptools/dist.py", line 701, in parse_config_files
parse_configuration(self, self.command_options,
File "/usr/lib/python3/dist-packages/setuptools/config.py", line 121, in parse_configuration
meta.parse()
File "/usr/lib/python3/dist-packages/setuptools/config.py", line 426, in parse
section_parser_method(section_options)
File "/usr/lib/python3/dist-packages/setuptools/config.py", line 399, in parse_section
self[name] = value
File "/usr/lib/python3/dist-packages/setuptools/config.py", line 184, in __setitem__
value = parser(value)
File "/usr/lib/python3/dist-packages/setuptools/config.py", line 515, in _parse_version
version = self._parse_attr(value, self.package_dir)
File "/usr/lib/python3/dist-packages/setuptools/config.py", line 349, in _parse_attr
module = import_module(module_name)
File "/usr/lib/python3.8/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 848, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/tmp/pip-install-9ia5l4ys/pytesseract/pytesseract/__init__.py", line 2, in <module>
from .pytesseract import ALTONotSupported
File "/tmp/pip-install-9ia5l4ys/pytesseract/pytesseract/pytesseract.py", line 28, in <module>
import Image
ModuleNotFoundError: No module named 'Image'
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
有谁知道我做错了什么?

最佳答案

尝试先安装 Pillow:

python3 -m pip install --upgrade Pillow
如果您想了解有关如何安装的更多信息,请点击此处: link !

关于python - 无法在阿里巴巴 EC 实例 (Ubuntu 20.04.2) 中为 python 3.8.10 安装 pytesseract,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68550618/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com