美文网首页
解决mac无法安装matplotlib的问题,typefree和

解决mac无法安装matplotlib的问题,typefree和

作者: 江魁 | 来源:发表于2017-11-27 12:19 被阅读0次

    安装matplotlib时报错,显示freetype和png未安装,搜了很久没有找到合适的处理办法,现在解决,分享如下。

    原理:使用brew安装freetype再安装另外一个包pkg-config;

    代码如下:

    curl -LsSfhttp://github.com/mxcl/homebrew/tarball/master| sudo tar xvz -C/usr/local --strip1

    sudo brew update

    sudo chown -R %当前用户 /usr/local

    sudo brew install wget

    sudo brew install freetype

    sudo brew install pkg-config

    接着试着再次尝试安装matplotlib

    pip install matplotlib

    如果此时报错缺少png,使用代码

    pip install pypng

    解决。

    相关文章

      网友评论

          本文标题:解决mac无法安装matplotlib的问题,typefree和

          本文链接:https://www.haomeiwen.com/subject/opgrbxtx.html