pip matplotlib报错equired packages can not be built解决

yipeiwu_com5年前Python基础

pip安装matplotlib

在centos6.5 64bit上用pip安装matplotlib时候报错:

* The following required packages can not be built:
            * freetype, png
error: Setup script exited with 1

这是因为pip不能安装操作系统的依赖库导致的,需要用yum手动安装:

$ yum -y install freetype-devel libpng-devel

如果不知道这些库需要安装的包名,可以查一下:

$ yum search freetype | grep devel
  freetype-devel.i686 : FreeType development libraries and header files
  freetype-devel.x86_64 : FreeType development libraries and header files
$ yum search png | grep devel
  libpng-devel.i686 : Development tools for programs to manipulate PNG image
  libpng-devel.x86_64 : Development tools for programs to manipulate PNG image

referance:

matplotlib简介,安装和简单实例代码

python的numpy模块安装不成功简单解决方法总结

总结

以上就是本文关于pip matplotlib报错equired packages can not be built解决的全部内容,希望对大家有所帮助。感兴趣的朋友可以继续参阅本站其他相关专题,如有不足之处,欢迎留言指出。感谢朋友们对本站的支持!

相关文章

启动targetcli时遇到错误解决办法

 启动targetcli时遭遇ImportError: cannot import name ALUATargetPortGroup故障 targetcli是一个iSCSI配置...

使用Python写一个小游戏

使用Python写一个小游戏

引言 最近python语言大火,除了在科学计算领域python有用武之地之外,在游戏、后台等方面,python也大放异彩,本篇博文将按照正规的项目开发流程,手把手教大家写个python小...

PyTorch中反卷积的用法详解

PyTorch中反卷积的用法详解

pytorch中的 2D 卷积层 和 2D 反卷积层 函数分别如下: class torch.nn.Conv2d(in_channels, out_channels, kernel_...

pytorch的梯度计算以及backward方法详解

pytorch的梯度计算以及backward方法详解

基础知识 tensors: tensor在pytorch里面是一个n维数组。我们可以通过指定参数reuqires_grad=True来建立一个反向传播图,从而能够计算梯度。在pytorc...

python 3.7.0 下pillow安装方法

python 3.7.0 下pillow安装方法

PIL(Python Imaging Library)是Python中一个强大的图像处理库,但目前其只支持到Python2.7 pillow是PIL的一个分支,虽是分支但是其与PIL同样...