今天在ubuntu1804上面使用pip安装matplotlib,安装失败,报错如下:

    ----------------------------------------
  Can't rollback pillow, nothing uninstalled.
Command "/usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-8i02wr9a/pillow/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-2l_5vc0n-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-8i02wr9a/pillow/

解决方法是先执行以下命令,安装依赖,再安装matplotlib

sudo apt-get install python-dev python3-dev libxml2-dev libxslt1-dev zlib1g-dev libsasl2-dev libldap2-dev build-essential libssl-dev libffi-dev libmysqlclient-dev libjpeg-dev libpq-dev libjpeg8-dev liblcms2-dev libblas-dev libatlas-base-dev 
 posted on 2022-04-27 14:44  onlyshuai  阅读(951)  评论(0)    收藏  举报