Python (Win 10):安装 matplotlib 需要包“freetype";和“png"? [英] Python (Win 10): Installing matplotlib requires packages "freetype" and "png"?

查看:143
本文介绍了Python (Win 10):安装 matplotlib 需要包“freetype";和“png"?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在尝试安装 Python 的 matplotlib 库以与 PyPlot 一起使用,以与 Julia 一起使用.除了最后一个库之外,我设法将所有东西都准备好了,我觉得我在试图让它工作时遇到了死胡同.

I've been trying to install Python's matplotlib library for use with PyPlot, for use with Julia. I managed to get everything in place except for this one final library, and I feel as though I've hit a deadend trying to get it working.

尝试安装 matplotlib 时(我曾尝试使用 pip、常规 python 安装和 easy_install),我在安装输出的最后收到以下消息,之后未安装:

When trying to install matplotlib (I've attempted using pip, regular python install, and easy_install), I get the following message at the very end of the install output, after which it is NOT installed:

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

对此感到困惑,我在网上四处查看并安装了这两种软件(至少,我认为它们是这样的).一个是freetype项目,另一个是LibPng,这是我通常能找到的最接近Windows或python的"png包"的东西.

Confused about this, I looked around online and installed both of these (at least, what I think these were). One was the freetype project, and the other was LibPng, which was the closest thing I could find to a "png package" for windows or python in general.

这最初不起作用(对于它们中的任何一个),我在某处读到我需要在 system32 文件夹中安装 freetype.dll.这是一个漫长的过程,但是我去了安装freetype的地方,然后拔出dll并将其重命名,并将其放置在system32中.当然这是行不通的(再次,远射).

This didn't initially work (for either of them), and I read somewhere that I needed a freetype.dll in my system32 folder. It was a long shot, but I went to where I installed freetype and pulled out the dll and renamed it, placing it in system32. This of course did not work (again, long shot).

无论如何,这就是我的位置.不知道从哪里开始,我不确定我是否甚至抓住了我应该使用的正确包".有想法吗?

Anyway, that's where I'm at. No idea where to go from here, and I'm unsure if I even grabbed the correct "packages" I should be using. Thoughts?

预先感谢

Ollie

推荐答案

使用更强大的安装程序

我建议使用 AnacondaMiniconda.根据我与许多Windows用户的经验,这是安装软件包(例如matplotlib)的最简单方法.

Use a more powerful installer

I would recommend to use Anaconda or Miniconda. In my experience with many Windows users, this is the simplest way to install packages such as matplotlib.

Anaconda 为科学家提供了许多软件包.Matplotlib开箱即用.只需以用户而非 root 身份安装即可.

Anaconda comes with many packages for scientists. Matplotlib works out of the box. Just install as user not root.

如果您不希望使用Ananconda的所有软件包,请使用 Miniconda

If you don't want all packages of Ananconda use Miniconda

两种安装方式(Anaconda 或 Miniconda)都提供 conda.它是一个改进的pip/virtualenv.

Both ways of installation (Anaconda or Miniconda) provide conda. It is an improved pip/virtualenv.

您可以使用以下命令安装 matplotilb:

You can install matplotilb with this command:

conda install matplotlib

环境:

您可以创建一个新环境并安装您喜欢的软件包:

Enviroments:

You can create a new environment and install the packages you like:

conda create -n my_project35 python=3.5
activate my_project35
conda install matplotlib

conda create -n my_project27 python=2.7
activate my_project27
conda install matplotlib

结合pip

您仍然可以使用 pip. conda 了解"它在做什么.

这篇关于Python (Win 10):安装 matplotlib 需要包“freetype";和“png"?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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