Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7925139
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T18:09:12+00:00 2026-06-03T18:09:12+00:00

I asked a question a couple of days ago regarding installing numpy on the

  • 0

I asked a question a couple of days ago regarding installing numpy on the same system. Thankfully, I managed to solve that one myself but unfortunately I am now stuck trying to install matplotlib.

I first of all tried the current distributed version but had no luck with that so I thought i would download the git repository and try that. I have got this far:

  • changed the make.osx file so that it will work in Python 3:
    • import urllib -> import urllib.request
    • urllib.urlretrieve() -> urllib.request.urlretrieve()

Even after that I still had a problem with it not finding the freetype2 headers. I googled around and discovered that I could solve this by editing a line in setupext.py:

  • 'darwin' : [], -> 'darwin' : ['/usr/local'],

However, I still get an error message when using the make.osx file. Here is how I am calling the file from Terminal:

  • sudo make -f make.osx PREFIX=/usr/local PYVERSION=3.2 fetch deps mpl_build mpl_install

I realise that matplotlib isn’t officially supported on Python 3 yet but I thought that maybe someone somewhere as at least managed to get it to compile/install?

Any help would be much appreciated,

Adam.

I have included the error I get below:

basedirlist is: ['/usr/local']
============================================================================
BUILDING MATPLOTLIB
            matplotlib: 1.2.x
                python: 3.2.2 (v3.2.2:137e45f15c0b, Sep  3 2011, 17:28:59)
                        [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)]
              platform: darwin

REQUIRED DEPENDENCIES
                 numpy: 1.6.2rc1
             freetype2: found, but unknown version (no pkg-config)

OPTIONAL BACKEND DEPENDENCIES
                libpng: found, but unknown version (no pkg-config)
               Tkinter: Tkinter: version not identified, Tk: 8.5, Tcl: 8.5
                  Gtk+: no
                        * Building for Gtk+ requires pygtk; you must be able
                        * to "import gtk" in your build/install environment
       Mac OS X native: yes
                    Qt: no
                   Qt4: Qt: 4.7.4, PyQt4: 4.8.6
                PySide: no
                 Cairo: no

OPTIONAL DATE/TIMEZONE DEPENDENCIES
              datetime: present, version unknown
              dateutil: matplotlib will provide
                  pytz: matplotlib will provide
adding pytz

OPTIONAL USETEX DEPENDENCIES
                dvipng: no
           ghostscript: /bin/sh: gs: command not found
                 latex: no

[Edit setup.cfg to suppress the above messages]
============================================================================
pymods ['pylab']
packages ['matplotlib', 'matplotlib.backends', 'matplotlib.backends.qt4_editor', 'matplotlib.projections', 'matplotlib.testing', 'matplotlib.testing.jpl_units', 'matplotlib.tests', 'mpl_toolkits', 'mpl_toolkits.mplot3d', 'mpl_toolkits.axes_grid', 'mpl_toolkits.axes_grid1', 'mpl_toolkits.axisartist', 'matplotlib.sphinxext', 'matplotlib.tri', 'matplotlib.delaunay', 'pytz', 'dateutil', 'dateutil.zoneinfo']
running build
running build_py
copying lib/matplotlib/mpl-data/matplotlibrc -> build/lib.macosx-10.6-intel-3.2/matplotlib/mpl-data
copying lib/matplotlib/mpl-data/matplotlib.conf -> build/lib.macosx-10.6-intel-3.2/matplotlib/mpl-data

running build_ext
building 'matplotlib.ft2font' extension
gcc-4.2 -DNDEBUG -g -O3 -arch i386 -arch x86_64 -I/usr/local/include -I/usr/local/include/freetype2 -isysroot /Developer/SDKs/MacOSX10.6.sdk -DPY_ARRAY_UNIQUE_SYMBOL=MPL_ARRAY_API -DPYCXX_ISO_CPP_LIB=1 -DPYCXX_PYTHON_2TO3=1 -I/usr/local/include -I/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/numpy/core/include -I/usr/local/include -I. -I/usr/local/include/freetype2 -I/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/numpy/core/include/freetype2 -I/usr/local/include/freetype2 -I./freetype2 -I/Library/Frameworks/Python.framework/Versions/3.2/include/python3.2m -c src/ft2font.cpp -o build/temp.macosx-10.6-intel-3.2/src/ft2font.o
In file included from /Library/Frameworks/Python.framework/Versions/3.2/include/python3.2m/bytearrayobject.h:9,
                 from /Library/Frameworks/Python.framework/Versions/3.2/include/python3.2m/Python.h:73,
                 from ./CXX/WrapPython.h:58,
                 from ./CXX/Extensions.hxx:37,
                 from src/ft2font.h:6,
                 from src/ft2font.cpp:3:
/Developer/SDKs/MacOSX10.6.sdk/usr/include/stdarg.h:4:25: error: stdarg.h: No such file or directory
In file included from /Developer/SDKs/MacOSX10.6.sdk/usr/include/c++/4.2.1/iosfwd:45,
                 from /Developer/SDKs/MacOSX10.6.sdk/usr/include/c++/4.2.1/bits/stl_algobase.h:70,
                 from /Developer/SDKs/MacOSX10.6.sdk/usr/include/c++/4.2.1/bits/char_traits.h:46,
                 from /Developer/SDKs/MacOSX10.6.sdk/usr/include/c++/4.2.1/string:47,
                 from ./CXX/Python3/Exception.hxx:47,
                 from ./CXX/Python3/Objects.hxx:45,
                 from ./CXX/Python3/Extensions.hxx:52,
                 from ./CXX/Extensions.hxx:42,
                 from src/ft2font.h:6,
                 from src/ft2font.cpp:3:
/Developer/SDKs/MacOSX10.6.sdk/usr/include/c++/4.2.1/i686-apple-darwin11/bits/c++locale.h: In function ‘int std::__convert_from_v(int* const&, char*, int, const char*, ...)’:
/Developer/SDKs/MacOSX10.6.sdk/usr/include/c++/4.2.1/i686-apple-darwin11/bits/c++locale.h:77: error: ‘va_start’ was not declared in this scope
/Developer/SDKs/MacOSX10.6.sdk/usr/include/c++/4.2.1/i686-apple-darwin11/bits/c++locale.h:85: error: ‘va_end’ was not declared in this scope
In file included from /Library/Frameworks/Python.framework/Versions/3.2/include/python3.2m/bytearrayobject.h:9,
                 from /Library/Frameworks/Python.framework/Versions/3.2/include/python3.2m/Python.h:73,
                 from ./CXX/WrapPython.h:58,
                 from ./CXX/Extensions.hxx:37,
                 from src/ft2font.h:6,
                 from src/ft2font.cpp:3:
/Developer/SDKs/MacOSX10.6.sdk/usr/include/stdarg.h:4:25: error: stdarg.h: No such file or directory
In file included from /Developer/SDKs/MacOSX10.6.sdk/usr/include/c++/4.2.1/iosfwd:45,
                 from /Developer/SDKs/MacOSX10.6.sdk/usr/include/c++/4.2.1/bits/stl_algobase.h:70,
                 from /Developer/SDKs/MacOSX10.6.sdk/usr/include/c++/4.2.1/bits/char_traits.h:46,
                 from /Developer/SDKs/MacOSX10.6.sdk/usr/include/c++/4.2.1/string:47,
                 from ./CXX/Python3/Exception.hxx:47,
                 from ./CXX/Python3/Objects.hxx:45,
                 from ./CXX/Python3/Extensions.hxx:52,
                 from ./CXX/Extensions.hxx:42,
                 from src/ft2font.h:6,
                 from src/ft2font.cpp:3:
/Developer/SDKs/MacOSX10.6.sdk/usr/include/c++/4.2.1/i686-apple-darwin11/x86_64/bits/c++locale.h: In function ‘int std::__convert_from_v(int* const&, char*, int, const char*, ...)’:
/Developer/SDKs/MacOSX10.6.sdk/usr/include/c++/4.2.1/i686-apple-darwin11/x86_64/bits/c++locale.h:77: error: ‘va_start’ was not declared in this scope
/Developer/SDKs/MacOSX10.6.sdk/usr/include/c++/4.2.1/i686-apple-darwin11/x86_64/bits/c++locale.h:85: error: ‘va_end’ was not declared in this scope
lipo: can't figure out the architecture type of: /var/tmp//ccafJH1l.out
error: command 'gcc-4.2' failed with exit status 1
make: *** [mpl_build] Error 1
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T18:09:13+00:00Added an answer on June 3, 2026 at 6:09 pm

    Okay…I think have managed to get matplotlib to install now…

    1. First of all you need to install numpy. I have instructions to do this on another post: install numpy

    2. Now open Terminal and clone the git repository for matplotlib (assumes you have git installed):

      • git clone git://github.com/matplotlib/matplotlib.git (this might take a while)
    3. Once the clone is complete open your user folder in Finder

    4. In your user folder open the matplotlib directory

    5. There is a file called `make.osx’ open this with TextEdit (or similar)

    6. Change the following lines:

      • MACOSX_DEPLOYMENT_TARGET=10.6
      • OSX_SDK_VER=10.6

      To:

      • MACOSX_DEPLOYMENT_TARGET=10.7
      • OSX_SDK_VER=10.7
    7. Change the following lines:

      • ${PYTHON} -c 'import urllib; urllib.urlretrieve("${ZLIBURL}", "${ZLIBFILE}")' &&\
        ${PYTHON} -c 'import urllib; urllib.urlretrieve("${PNGURL}", "${PNGFILE}")' &&\
        ${PYTHON} -c 'import urllib; urllib.urlretrieve("${FREETYPEURL}", "${FREETYPEFILE}")'

      To:

      • ${PYTHON} -c 'import urllib.request; urllib.request.urlretrieve("${ZLIBURL}", "${ZLIBFILE}")' &&\
        ${PYTHON} -c 'import urllib.request; urllib.request.urlretrieve("${PNGURL}", "${PNGFILE}")' &&\
        ${PYTHON} -c 'import urllib.request; urllib.request.urlretrieve("${FREETYPEURL}", "${FREETYPEFILE}")'
    8. Save the changes

    9. Open the file called setupext.py in idle

    10. Find the line 'darwin' : [], and change it to 'darwin' : ['/usr/local'],

    11. Save the file

    12. Open Terminal again and type the following:

      • sudo make -f make.osx PREFIX=/usr/local PYVERSION=3.2 fetch deps mpl_build mpl_install
    13. After some time matplotlib should be installed in the following directory:

      • /usr/local/lib/Python3.2/site-packages/
    14. Open the above directory and also the following directory:

      • /Library/Python/3.2/site-packages/
    15. Copy/move the following directories from /usr/local/lib/Python3.2/site-packages/ to /Library/Python/3.2/site-packages/:

      • dateutil
      • matplotlib
      • mpl_toolkits
    16. matplotlib should be now installed

    17. If you open idle and type import matplotlib it shouldn’t return an error

    18. I tried out the matplotlib/examples/user_interfaces/embedding_in_qt4_wtoolbar.py file and it seems works fine

    Hope someone else finds this useful!

    Thanks again for the assistance,

    Adam.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I asked a question a couple days ago about creating INSERTs by running a
A couple of days ago I asked a question about how to replace and
I asked this question <input type="hidden" functionality issue a couple of days ago and
I asked a similar question a couple of days ago, but I'm looking for
I've asked a question here couple days ago, about how to avoid a function
This is similar to a question I asked a couple of days ago. However,
I asked a question similar to this one a couple of weeks ago, but
I have asked a couple of questions over the last couple of days, that
Question asked a couple minutes ago gave me this idea... If you were to
Hi I asked a question on here a couple of weeks ago about speeding

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.