【问题标题】:Installing matplotlib on windows 64bit python 3.5在 Windows 64 位 python 3.5 上安装 matplotlib
【发布时间】:2015-11-05 04:16:06
【问题描述】:

由于 python 3.5 的 matplotlib 还没有 official release,所以我尝试使用 pip。

pip install matplotlib

它说我缺少一些必需的依赖项和扩展

REQUIRED DEPENDENCIES AND EXTENSIONS
                 numpy: yes [version 1.10.0.post2]
                   six: yes [using six version 1.9.0]
              dateutil: yes [using dateutil version 2.4.2]
                  pytz: yes [using pytz version 2015.6]
               tornado: yes [using tornado version 4.2.1]
             pyparsing: yes [using pyparsing version 2.0.3]
                 pycxx: yes [Official versions of PyCXX are not compatible
                        with matplotlib on Python 3.x, since they lack
                        support for the buffer object.  Using local copy]
                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.]
[...]
Command "python setup.py egg_info" failed with error code 1 in C:\Users\me\AppData\Local\Temp\pip-build-bjiqixce\matplotlib

但我的系统上安装了 freetype 和 png。

C:\Users\me>where ft2build.h
C:\Users\me\libs\GnuWin32\include\ft2build.h
C:\Users\me>where png.h
C:\Users\me\libs\GnuWin32\include\png.h

所有这些都以普通用户权限安装。我在这里做错了什么?

编辑:是的,python 3.5 版本现已存在。

【问题讨论】:

    标签: python matplotlib


    【解决方案1】:

    诺兹德鲁姆,

    在为 python 3.5 安装 Matplotlib 时,我遇到了和你一样的问题。对我有用的是首先为CMake 下载一个二进制发行版,然后为VS2010 安装带有ISO 的VB2010。在我完成 CMake 和 VB2010 的下载和安装后,我再次运行

    pip install matplotlib
    

    另外,如果以前的解决方案不起作用,虽然以下对我不起作用,但有一组由 jbmohler 编译的脚本用于在 windows 上构建 matplotlib:

    这是一组脚本,用于从 MS 上的源代码构建 matplotlib 视窗平台。它构建 matplotlib 只需要 Visual Studio 和 CMake 作为先决条件;嵌入了其他库依赖项 在这个存储库中。任何复杂或其他依赖项都是 考虑了此构建脚本中的错误。

    http://www.python.org 提供的 Python 是用 Visual 编译的 Studio 2008 用于 3.3 之前的版本和 Visual Studio 2010 用于 3.3 和 之后。 Python 扩展推荐用相同的方式编译 编译器。这些脚本和 matplotlib setup.py 寻找 通过 distutils 的正确版本。 .NET Framework 4.0 是必需的 MSBuild,但您可能已经拥有它。

    除了 Visual Studio 之外,构建 libpng 还需要 CMake。 对于构建文档,您需要安装 numpydoc 和 米克特克斯。所需的 freetype、zlib、libpng、tcl 和 tk 源代码是 与此存储库捆绑在一起,因为没有规范的 Windows 包管理器。

    要在 Python 中构建和安装 matplotlib,请执行以下操作:

    git clone https://github.com/matplotlib/matplotlib 
    git clone https://github.com/jbmohler/matplotlib-winbuild            
    python matplotlib-winbuild\buildall.py
    

    构建脚本将自动检测 Python 版本和 32/64 位 自动。

    这些脚本的来源是 cgohlke 在 https://github.com/matplotlib/matplotlib/issues/1717

    【讨论】:

    • 非常感谢 :D 安装 cmake 足以使 pip 安装程序正常工作。
    • 没问题,很高兴我能帮上忙。
    猜你喜欢
    • 2016-09-07
    • 1970-01-01
    • 2016-07-06
    • 1970-01-01
    • 1970-01-01
    • 2018-09-24
    • 2015-02-28
    相关资源
    最近更新 更多