Aysegul Engin
Aysegul Engin

Reputation: 23

matplotlib installation error with python 3.5

I am trying to install matplotlib on OS X Yosemite with Python 3.5. The packages which are already installed are:

appnope (0.1.0)
decorator (4.0.2)
gnureadline (6.3.3)
ipython (4.0.0)
ipython-genutils (0.1.0)
nose (1.3.7)
numpy (1.9.2)
pandas (0.16.2)
path.py (8.1.1)
pbr (1.8.0)
pexpect (3.3)
pickleshare (0.5)
pip (7.1.2)
Pygments (2.0.2)
python-dateutil (2.4.2)
pytz (2015.4)
pyzmq (14.7.0)
scipy (0.16.0)
setuptools (18.3.1)
simplegeneric (0.8.1)
six (1.9.0)
stevedore (1.8.0)
sympy (0.7.6.1)
traitlets (4.0.0)
virtualenv (13.1.2)
virtualenv-clone (0.2.6)
virtualenvwrapper (4.7.1)
wheel (0.24.0)

moreover

freetype-config --version 18.0.12

I have installed freetype via Macport

However I keep getting the following error:

Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/_t/n0g5nl692778w02hdlnf127h0000gn/T/pip-build-82786k0f/matplotlib

The complete message I receive after the installation command is:

 pip3 install matplotlib

Collecting matplotlib
  Using cached matplotlib-1.4.3.tar.gz
    Complete output from command python setup.py egg_info:
    IMPORTANT WARNING:
        pkg-config is not installed.
        matplotlib may not be able to find some of its dependencies
    ============================================================================
    Edit setup.cfg to change the build options

    BUILDING MATPLOTLIB
                matplotlib: yes [1.4.3]
                    python: yes [3.5.0 (v3.5.0:374f501f4567, Sep 12 2015,
                            11:00:19)  [GCC 4.2.1 (Apple Inc. build 5666) (dot
                            3)]]
                  platform: yes [darwin]

    REQUIRED DEPENDENCIES AND EXTENSIONS
                     numpy: yes [version 1.9.2]
                       six: yes [using six version 1.9.0]
                  dateutil: yes [using dateutil version 2.4.2]
                      pytz: yes [using pytz version 2015.4]
                   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.]
                     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 freetype2 (ft2build.h)
                            could not be found.  You may need to install the
                            development package.]
                       png: yes [version 1.6.18]
                     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 [using nose version 1.3.7 / using unittest.mock]
            toolkits_tests: yes [using nose version 1.3.7 / using unittest.mock]

    OPTIONAL BACKEND EXTENSIONS
                    macosx: yes [installing, darwin]
                    qt5agg: no  [PyQt5 not found]
                    qt4agg: no  [PyQt4 not found]
                    pyside: no  [PySide 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, version version not identified]
                     wxagg: no  [requires wxPython]
                       gtk: no  [Requires pygtk]
                       agg: yes [installing]
                     cairo: no  [cairocffi or pycairo not found]
                 windowing: no  [Microsoft Windows only]

    OPTIONAL LATEX DEPENDENCIES
                    dvipng: yes [version 1.15]
               ghostscript: yes [version 9.16]
                     latex: yes [version 3.14159265]
                   pdftops: no

    ============================================================================
                            * The following required packages can not be built:
                            * freetype

    ----------------------------------------

Upvotes: 2

Views: 2600

Answers (1)

Djordje Ilic
Djordje Ilic

Reputation: 36

it seems you haven't pkg-config installed.

Just install it via brew:

brew install pkg-config

To be on the safer side also install the unresolved dependencies:

pip3 install tornado pyparsing

Upvotes: 2

Related Questions