2014-02-27 97 views
9

我正在使用virtualenv进行django安装。我正在尝试构建一个从日志中提取数据然后绘制数据的视图。最终我希望有这个实时和现场。如果您对其他解决方案有任何最适合我的项目的建议,请不要犹豫,将它们包含在下面的评论栏中。Matplotlib安装问题。 Pip Centos - Freetype“Missing”安装时

我试图从pip使用pip install matplotlib安装matplotlib。

我收到以下消息:

* The following required packages can not be built: 
* freetype 

我然后验证它是否已安装

yum install freetype 
Package freetype-2.3.11-14.el6_3.1.x86_64 already installed and latest version 

后来我发现,有一个上python-matplotlib这是一个旧版本0.99。但是,我希望将其保留在虚拟环境中而不是系统范围内。

find/-name *freetype* 
/var/lib/yum/yumdb/f/d2807dcfe3762c0b9f8ef1d9bf0f05788e73282a-freetype-2.3.11-14.el6_3.1- x86_64 
/usr/lib64/libfreetype.so.6.3.22 
/usr/lib64/libfreetype.so.6 
/usr/share/doc/freetype-2.3.11 

我搜索了所有的stackoverflow,只看到解决方案的Ubuntu没有转移到centos。

谢谢您的时间, 约翰

回答

0

我有这种事发生在我在两种不同的情况,看看你是其中之一:安装

  1. FreeType的,但不是在$PATH呢。刚退出壳并开始一个新的固定。

  2. 我从源码构建matplotlib,并试图从master分支构建。在我切换到v1.3.x后,它正确检测到了freetype。

2

我刚刚有一个类似的情况(尽管不完全一样)。当这个页面出现在第一个搜索结果中时,我会在这里写下它。

  • 的CentOS 5
  • pip install matplotlib抱怨freetype
  • 两个freetypefreetype-devel安装。
  • ~/.pip/pip.log提供了对问题的解释。有行:

    freetype: no [Requires freetype2 2.3 or later. Found 2.2.1.]

  • 显然,解决方法是,升级freetype或降级matplotlib
  • 第二个更容易(假设我对旧版本没问题)。
  • pip install matplotlib==1.3.1工作正常。
9

pip将在本地计算机上编译matlibplot,因此您还需要安装freetype开发头文件。

CentOS的6+,Fedora等等:

$ sudo yum -y install freetype freetype-devel libpng-devel 

在老的操作系统(如CentOS的5),你可能会matlibplot的新版本运行到一个更具体的FreeType的版本问题。如果你的版本无关,与传统的1.3.x版本坚持将否定这些关联问题:

$ pip install matplotlib==1.3.1 

请注意,您可能需要您numpy的降级到1.8,以使matplotlib 1.3工作。

$ pip install numpy==1.8 

祝你好运!

+0

在CentOS 5上为我工作 –