Matplotlib 安装问题.Pip Centos - Freetype “Missing"安装时 [英] Matplotlib install issues. Pip Centos - Freetype "Missing" when it is installed

查看:38
本文介绍了Matplotlib 安装问题.Pip Centos - Freetype “Missing"安装时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 virtualenv 进行 django 设置.我正在尝试构建一个从日志中提取数据然后绘制数据图表的视图.最终我想拥有这个实时和生活.如果您对最适合我的项目的其他解决方案有任何建议,请不要犹豫,将它们包含在下面的评论字段中.

I am using a virtualenv for a django setup. I am trying to build a view that pulls data from logs and then graphs the data. Eventually I would like to have this real-time and live. If you have any recommendations on other solutions that would suit my project best, please do not hesitate to include them in the comment fields below.

我尝试使用 pip install matplotlib 从 pip 安装 matplotlib.

I have attempted to install matplotlib from pip using pip install 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 是旧版本 .99.但是,我想将其保留在虚拟环境中,而不是系统范围内.

I then found that there is a python-matplotlib which is an older version .99. However, I want to keep this inside of the virtual environment and not system wide.

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,只看到了没有转移到centos的ubuntu解决方案.

I searched all over stackoverflow and only saw solutions for ubuntu which did not transfer over to centos.

感谢您的宝贵时间,约翰

Thank you for your time, John

推荐答案

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

pip is going to compile matlibplot on your local machine, so you'll need freetype development headers installed as well.

CentOS 6+、Fedora 等:

CentOS 6+, Fedora, etc.:

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

在较旧的操作系统(例如 CentOS 5)上,较新版本的 matlibplot 可能会遇到更具体的自由类型版本控制问题.如果您与版本无关,坚持使用旧版 1.3.x 版本将消除这些依赖性问题:

On older operating systems (e.g. CentOS 5), you may run into a more specific freetype versioning issue with newer releases of matlibplot. If you're version agnostic, sticking with a legacy 1.3.x release will negate these dependency issues:

$ pip install matplotlib==1.3.1

请注意,您可能需要将 numpy 降级到 1.8 才能使 matplotlib 1.3 工作.

Please note, you may need to downgrade your numpy to 1.8 in order to make matplotlib 1.3 work.

$ pip install numpy==1.8

祝你好运!

这篇关于Matplotlib 安装问题.Pip Centos - Freetype “Missing"安装时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆