3

Since there is not yet a official release for matplotlib for Python 3.5, I tried to use pip.

pip install matplotlib

It says I am missing some required dependencies and extensions.

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

But I have freetype and png installed on my system.

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

All of these are installed with normal users privileges. What am I doing wrong here?

Edit: yay Python 3.5 version now exists.

1 Answer 1

1

Nozdrum,

When installing Matplotlib for python 3.5, I came across the same problem as you. What worked for me was first downloading one of the binary distros for CMake and then installing VB2010 with the ISO for VS2010. After I finished the download and install for both CMake and VB2010, I then again ran

pip install matplotlib

Also, if the previous solution did not work, though the following did not work for me, there is a set of scripts compiled by jbmohler to build matplotlib on windows:

this is a set of scripts to build matplotlib from source on the MS Windows platform. It builds matplotlib requiring only Visual Studio and CMake as pre-requisites; other library dependencies are embedded in this repository. Any complicated or other dependencies are considered bugs in this build script.

The Python shipped from http://www.python.org is compiled with Visual Studio 2008 for versions before 3.3 and Visual Studio 2010 for 3.3 and later. Python extensions are recommended to be compiled with the same compiler. These scripts and the matplotlib setup.py look for the correct version via distutils. The .NET Framework 4.0 is required for MSBuild, but you likely already have it.

In addition to Visual Studio CMake is required for building libpng. For building documentation, you will need to install numpydoc and miktex. The required freetype, zlib, libpng, tcl, & tk source code is bundled with this repository since there is no canonical Windows package manager.

To build & install matplotlib in your Python, do:

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

The build script will auto-detect Python version & 32/64 bit automatically.

The origin of these scripts is the comment by cgohlke in https://github.com/matplotlib/matplotlib/issues/1717

Sign up to request clarification or add additional context in comments.

2 Comments

Thank you so much :D Installing cmake was enough to make the pip installer work.
No problem, glad I could help.