1.报错背景

在ubuntu中,python3.8下pip3安装pytesseract,一直报错,如下:

error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

----------------------------------------

Command "/usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-mcnfynsl/Pillow/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace(' ', ' ');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-8krn7_ph-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-mcnfynsl/Pillow/

如图:

2.解决方案

安装对应python版本的dev,即:

sudo apt-get install python3.8-dev