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

安装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

解决。

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容