Windows 7上针对freetype、png软件包的Python matplotlib安装问题

Windows 7上针对freetype、png软件包的Python matplotlib安装问题,python,windows,python-2.7,matplotlib,windows-7,Python,Windows,Python 2.7,Matplotlib,Windows 7,在Windows7上使用Python 2.7。下面是我用来安装的命令和错误消息。想知道以前是否有人遇到过类似的问题?谢谢 C:\Python27\Scripts>pip install matplotlib Collecting matplotlib Downloading matplotlib-1.5.2.tar.gz (51.6MB) 100% |################################| 51.6MB 19kB/s Complete out

在Windows7上使用Python 2.7。下面是我用来安装的命令和错误消息。想知道以前是否有人遇到过类似的问题?谢谢

C:\Python27\Scripts>pip install matplotlib
Collecting matplotlib
  Downloading matplotlib-1.5.2.tar.gz (51.6MB)
    100% |################################| 51.6MB 19kB/s
    Complete output from command python setup.py egg_info:
    ============================================================================

    Edit setup.cfg to change the build options

    BUILDING MATPLOTLIB
                matplotlib: yes [1.5.2]
                    python: yes [2.7.11 (v2.7.11:6d1b6a68f775, Dec  5 2015,
                            20:40:30) [MSC v.1500 64 bit (AMD64)]]
                  platform: yes [win32]

    REQUIRED DEPENDENCIES AND EXTENSIONS
                     numpy: yes [version 1.11.1]
                  dateutil: yes [dateutil was not found. It is required for date

                            axis support. pip/easy_install may attempt to
                            install it after matplotlib.]
                      pytz: yes [pytz was not found. pip will attempt to install

                            it after matplotlib.]
                    cycler: yes [cycler was not found. pip will attempt to
                            install it after matplotlib.]
                   tornado: yes [tornado was not found. It is required for the
                            WebAgg backend. pip/easy_install may attempt to
                            install it after matplotlib.]
                 pyparsing: yes [pyparsing was not found. It is required for
                            mathtext support. pip/easy_install may attempt to
                            install it after matplotlib.]
                    libagg: yes [pkg-config information for 'libagg' could not
                            be found. Using local copy.]
                  freetype: no  [The C/C++ header for freetype (ft2build.h)
                            could not be found.  You may need to install the
                            development package.]
                       png: no  [The C/C++ header for png (png.h) could not be
                            found.  You may need to install the development
                            package.]
                     qhull: yes [pkg-config information for 'qhull' could not be

                            found. Using local copy.]

    OPTIONAL SUBPACKAGES
               sample_data: yes [installing]
                  toolkits: yes [installing]
                     tests: yes [nose 0.11.1 or later is required to run the
                            matplotlib test suite. Please install it with pip or

                            your preferred tool to run the test suite / mock is
                            required to run the matplotlib test suite. Please
                            install it with pip or your preferred tool to run
                            the test suite]
            toolkits_tests: yes [nose 0.11.1 or later is required to run the
                            matplotlib test suite. Please install it with pip or

                            your preferred tool to run the test suite / mock is
                            required to run the matplotlib test suite. Please
                            install it with pip or your preferred tool to run
                            the test suite]

    OPTIONAL BACKEND EXTENSIONS
                    macosx: no  [Mac OS-X only]
                    qt5agg: no  [PyQt5 not found]
                    qt4agg: no  [PySide not found; PyQt4 not found]
                   gtk3agg: no  [Requires pygobject to be installed.]
                 gtk3cairo: no  [Requires cairocffi or pycairo to be installed.]

                    gtkagg: no  [Requires pygtk]
                     tkagg: yes [installing; run-time loading from Python Tcl /
                            Tk]
                     wxagg: no  [requires wxPython]
                       gtk: no  [Requires pygtk]
                       agg: yes [installing]
                     cairo: no  [cairocffi or pycairo not found]
                 windowing: yes [installing]

    OPTIONAL LATEX DEPENDENCIES
                    dvipng: no
               ghostscript: no
                     latex: no
                   pdftops: no

    OPTIONAL PACKAGE DATA
                      dlls: no  [skipping due to configuration]

    ============================================================================

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

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in c:\users\foo\a
ppdata\local\temp\pip-build-zxfsow\matplotlib\

从上述位置获取matplotlib。选择基于python(2.x/3.x)和bit(32/64)版本的正确包

如果您在中间遇到任何问题,请参考以下链接:


如您所见,
png
freetype
模块缺失。您需要单独安装它们

尝试执行以下操作:

> pip install freetype-py
> pip install pypng
> pip install matplotlib

我用1.5.1版解决了这个问题

pip install matplotlib==1.5.1

1.5.2版安装程序似乎已损坏。

我遇到了与您相同的问题,下面是我的解决方案

与最新pip集成的Python3.6存在问题。 所以我安装了带有pip的Python3.5.2,但没有升级pip。 您可以通过这种方式安装matplotlib


希望我能提供一个可能的解决方案

我遇到了完全相同的问题

似乎我的pip是v7,这是旧的。 使用“升级”按钮升级到v9。 然后再次尝试安装matplotlib,这次成功


也许这有帮助

我在Wİndows 10中解决了以下相同的问题:

1-为win32或win64 python3.7下载以下文件:

matplotlib-2.2.2-cp27-cp37m-win32.whl

2-通过cmd控制台在python下运行下载的文件:

.\Downloads> python -m pip install matplotlib-2.2.2-cp37-cp37m-win_amd64.whl

您可以尝试matplolib

我今天在Python 3.8.0上遇到了这个问题,在我安装了
freetype py
之后,matplolib==3.2.0rc1安装了特定的matplolib版本2.2.5,并在Windows 10上成功安装

命令要求通过pip安装特定版本:

pip install matplotlib==2.2.5

投赞成票谢谢Ryan,但你的方法仍然有问题。我试过be_good_do_good的非官方软件包,效果很好。:)虽然我可以安装frretype py和pypng,但不幸的是,matplotlib似乎需要确切的png和freetype软件包名称。要使
matplotlib
安装程序成功,您还需要安装
libpng-devel
libfreetype-devel
软件包-软件包名称没有问题(我花了一个小时才弄明白)。@zelanix pip找不到任何名为libpng-devel或libfreetype-devel的软件?@Niels-不,没错-它们是操作系统软件包。请使用
apt
或与您的系统相当的软件包安装它们(尽管请注意,确切的软件包名称可能不同-我想当时我正在使用Cygwin)。只需在我的需求中添加“matplotlib==2.2.2”就解决了这个问题。TnkxThanks!这是我在公司网络中的计算机上,通过虚拟环境中的命令提示符,在Windows 10和Python 3.8上工作的唯一方法。
.\Downloads> python -m pip install matplotlib-2.2.2-cp37-cp37m-win_amd64.whl
pip install matplotlib==2.2.5