2015-10-16 181 views
1

由于python 3.5还没有用于matplotlib的official release,所以我尝试使用pip。在windows 64bit安装matplotlib python 3.5

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 

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

编辑:yay python 3.5版本现在存在。

回答

1

Nozdrum,

当安装Matplotlib为Python 3.5,我碰到了同样的问题来了,你。对我而言,首先下载CMake的二进制发行版之一,然后在VS2010中安装VB2010和ISO。当我完成下载和安装都CMake和VB2010,然后我又跑

pip install matplotlib 

而且,如果以前的解决方案没有奏效,尽管以下没有工作对我来说,有编了一套脚本通过jbmohler在Windows上建立matplotlib:

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

http://www.python.org发货的Python与以前版本的Visual Studio编译器一起使用Visual Studio 2008 2008和3.3和以后版本的Visual Studio 2010和 。推荐使用与编译器相同的 编译Python扩展。这些脚本和matplotlib setup.py通过distutils查找 正确的版本。对于 MSBuild,需要.NET Framework 4.0,但您可能已经拥有它。

除了构建libpng需要Visual Studio CMake之外。 对于构建文档,您需要安装numpydoc和 miktex。所需的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 

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

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

+0

的评论太感谢你了:d安装cmake的足以让画中画安装工作。 – Nozdrum

+0

没问题,很高兴我可以帮忙。 – Deathrast