您的位置:首页 > 大数据 > 人工智能

pycharm 和SHELL下安装MATPLOTLIB均失败, 出现Command "python setup.py egg_info" failed with error code 1 的解决方案

2019-01-19 00:57 561 查看

本人在pycharm 和SHELL下安装MATPLOTLIB均失败, 出现Command “python setup.py egg_info” failed with error code 1 的解决方案。

花了好多方式解决, 试过:

python -m pip install --upgrade --force pip
pip install setuptools==33.1.1

后仍然没解决。

进一步看出错信息后显示:
freetype: no [The C/C++ header for freetype2 (ft2build.h) could not be found. You may need to install the development package.] png: no [pkg-config information for ‘libpng’ could not be found.] * The following required packages can not be built: * freetype, png

说明缺少依赖的包freetype和libpng。

在SHELL下,采用如下方式:

  1. 安装libpng
    使用如下命令:

    sudo apt-get install libpng-dev

  2. 安装freetype

    cd ~/Downloads
    wget http://download.savannah.gnu.org/releases/freetype/freetype-2.6.5.tar.gz
    tar -zxvf freetype-2.6.5.tar.gz
    cd freetype-2.6.5/ ./congfigure
    sudo make
    sudo make install

最后运行

sudo pip3 install matplotlib

安装约15分钟后显示成功安装。

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐