failed to install Matplotlib on Mac OS Snow Leopard

30 views
Skip to first unread message

hc

unread,
Jun 8, 2010, 12:20:40 PM6/8/10
to scitools
Hello:

I tried "Easy Install" to install Matplotlib on Mac OS Snow Leopard,
but I failed. Before the installation of Matplotlib, I installed
Xcode, Python, Numpy, Scipy, Gnuplot. For now, I have no problem using
Gnuplot, Numpy, or Scipy from Python. Is there any effective way to
put Matplotlab+SciTools to work? Can I go ahead to download and
install the source files after my failure to make the binary copy work
on my mac? Your advice will be highly appreciated

hc

Johannes Ring

unread,
Jun 8, 2010, 12:34:50 PM6/8/10
to scit...@googlegroups.com

Why not use the Matplotlib installer for OS X 10.6? You can find it here:

http://sourceforge.net/projects/matplotlib/files/matplotlib/matplotlib-0.99.3/

Johannes

hc

unread,
Jun 8, 2010, 1:00:48 PM6/8/10
to scitools
Johannes,

Thanks. But I did use the Matplotlib installer to do so-called "Easy
Install" at the beginning. It did not work on my mac os snow leopard.

hc

On Jun 8, 12:34 pm, Johannes Ring <joha...@simula.no> wrote:
> http://sourceforge.net/projects/matplotlib/files/matplotlib/matplotli...
>
> Johannes

Johannes Ring

unread,
Jun 8, 2010, 1:23:56 PM6/8/10
to scit...@googlegroups.com
On Tue, Jun 8, 2010 at 7:00 PM, hc <hwa...@gmail.com> wrote:
> Johannes,
>
> Thanks. But I did use the Matplotlib installer to do so-called "Easy
> Install" at the beginning. It did not work on my mac os snow leopard.

I see. Did you try the .egg or the .dmg installer? If you tried the
.egg, try the .dmg instead. I just tried the .dmg and it worked fine
for me.

Maybe you should try to post your installation problem on the
Matplotlib mailing list?

Johannes

> hc
>
> On Jun 8, 12:34 pm, Johannes Ring <joha...@simula.no> wrote:
>> On Tue, Jun 8, 2010 at 6:20 PM, hc <hwan...@gmail.com> wrote:
>> > Hello:
>>
>> > I tried "Easy Install" to install Matplotlib on Mac OS Snow Leopard,
>> > but I failed. Before the installation of Matplotlib, I installed
>> > Xcode, Python, Numpy, Scipy, Gnuplot. For now, I have no problem using
>> > Gnuplot, Numpy, or Scipy from Python. Is there any effective way to
>> > put Matplotlab+SciTools to work? Can I go ahead to download and
>> > install the source files after my failure to make the binary copy work
>> > on my mac? Your advice will be highly appreciated
>>
>> Why not use the Matplotlib installer for OS X 10.6? You can find it here:
>>
>> http://sourceforge.net/projects/matplotlib/files/matplotlib/matplotli...
>>
>> Johannes
>

> --
> You received this message because you are subscribed to the Google Groups "scitools" group.
> To post to this group, send email to scit...@googlegroups.com.
> To unsubscribe from this group, send email to scitools+u...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/scitools?hl=en.
>
>

hc

unread,
Jun 8, 2010, 4:34:04 PM6/8/10
to scitools
Johannes:

I already tried the .dmg installer and it did not work.

On the Terminal (mac os snow leopard), I got the error messages are:

----------------------------------------------------------
Last login: Tue Jun 8 16:24:19 on ttys000
hc-MacBook-Pro:~ hc$ > python -c 'import matplotlib; print
matplotlib.__version__, matplotlib.__file__'
-bash: -c: command not found
hc-MacBook-Pro:~ hc$
---------------------------------------------------------

One the Terminal (mac os snow leopard), I opened Python, entered
"import pylab", and got the error messages:
-----------------------------------------------------------------------------------------
Last login: Tue Jun 8 16:15:19 on ttys000
hc-MacBook-Pro:~ hc$ python
Python 2.6.5 (r265:79359, Mar 24 2010, 01:32:55)
[GCC 4.0.1 (Apple Inc. build 5493)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import pylab
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named pylab
>>>
----------------------------------------------------------------------------------------

I have not tried the .egg copy yet.

Any clue?

hc















On Jun 8, 1:23 pm, Johannes Ring <joha...@simula.no> wrote:

Johannes Ring

unread,
Jun 9, 2010, 4:24:51 AM6/9/10
to scit...@googlegroups.com
On Tue, Jun 8, 2010 at 10:34 PM, hc <hwa...@gmail.com> wrote:
> Johannes:
>
> I already tried the .dmg installer and it did not work.

OK. So what was the problem? No error messages?

> On the Terminal (mac os snow leopard), I got the error messages are:
>
> ----------------------------------------------------------
> Last login: Tue Jun  8 16:24:19 on ttys000
> hc-MacBook-Pro:~ hc$ > python -c 'import matplotlib; print
> matplotlib.__version__, matplotlib.__file__'
> -bash: -c: command not found
> hc-MacBook-Pro:~ hc$
> ---------------------------------------------------------

This looks strange. Does this work

python -c 'import os'

or this

python -c "import os"

?

> One the Terminal (mac os snow leopard), I opened Python, entered
> "import pylab", and got the error messages:
> -----------------------------------------------------------------------------------------
> Last login: Tue Jun  8 16:15:19 on ttys000
> hc-MacBook-Pro:~ hc$ python
> Python 2.6.5 (r265:79359, Mar 24 2010, 01:32:55)
> [GCC 4.0.1 (Apple Inc. build 5493)] on darwin
> Type "help", "copyright", "credits" or "license" for more information.
>>>> import pylab
> Traceback (most recent call last):
>  File "<stdin>", line 1, in <module>
> ImportError: No module named pylab
>>>>
> ----------------------------------------------------------------------------------------
>
> I have not tried the .egg copy yet.
>
> Any clue?

Sorry, the dmg installer worked fine for me so I can't reproduce your
problem. You can try building Matplotlib from source. I have not tried
this myself on a Mac so I'm not sure how straightforward it is.
Anyway, you will probably get better support by asking at the
Matplotlib mailing list.

Hans Petter Langtangen

unread,
Jun 9, 2010, 6:54:33 AM6/9/10
to scit...@googlegroups.com
Wed, 09 Jun Johannes Ring wrote:
> On Tue, Jun 8, 2010 at 10:34 PM, hc <hwa...@gmail.com> wrote:
> > Johannes:
> >
> > I already tried the .dmg installer and it did not work.
>
> OK. So what was the problem? No error messages?
>
> > On the Terminal (mac os snow leopard), I got the error messages are:
> >
> > ----------------------------------------------------------
> > Last login: Tue Jun �8 16:24:19 on ttys000
> > hc-MacBook-Pro:~ hc$ > python -c 'import matplotlib; print
> > matplotlib.__version__, matplotlib.__file__'
> > -bash: -c: command not found
> > hc-MacBook-Pro:~ hc$
> > ---------------------------------------------------------
>
> Sorry, the dmg installer worked fine for me so I can't reproduce your
> problem. You can try building Matplotlib from source. I have not tried
> this myself on a Mac so I'm not sure how straightforward it is.
> Anyway, you will probably get better support by asking at the
> Matplotlib mailing list.

One can easily get several Python installations on a Mac. Can you do

unix> which python

in a terminal window?

And can you find Python installed in /Applications? Those might be
two different Pythons. The .dmg files normally install in /Applications,
while setup.py and .egg files normally go to the python executable
that you reach in the terminal window (the first python executable found
in a directory in your PATH variable).

On my Mac (Snow Leopard), I have three pythons:

/sw/bin/python (installed by fink)
/usr/bin/python (it probably came with the system)
/home/hpl/.../python (my own compiled latest version Python, this is the one I use)

You have to know which one you're using... It's my experience with Mac
that you need quite some Unix competence to manage software that
consists of many components and that comes from different
sources. That's why we recommend, in general, students to run Ubuntu
in a VirtualBox on the Mac and do Python programming in Ubuntu. It's
an order of magnitude simpler to install all the software you need in
Ubuntu (cf. apt-get install python-scitools :-)
But if you want to qualify for excellence in software build & install,
Mac is a wonderful training platform.

Hans Petter

hc

unread,
Jun 9, 2010, 10:55:39 AM6/9/10
to scitools
My installed python is python 2.6.5.
---------------------------------------------------------------------------------------
Last login: Wed Jun 9 10:41:22 on ttys000
hc-MacBook-Pro:~ hc$ which python
/Library/Frameworks/Python.framework/Versions/2.6/bin/python
hc-MacBook-Pro:~ hc$
------------------------------------------------------------------------------------------

The Application folder has python 2.6.5 only.

I just don't understand why python+numpy+scipy+gnuplot works, but why
python+matplotlib does not. I installed older versions of python
thorugh macports, but they were deleted before I did the matplotlib
installation.

hc

Johannes Ring

unread,
Jun 9, 2010, 11:04:27 AM6/9/10
to scit...@googlegroups.com
OK, so you have installed Python manually and not using system Python?
I have this:

$ which python
/usr/bin/python
$ python --version
Python 2.6.1

Try to import matplotlib with system Python. I get this:

$ /usr/bin/python -c "import matplotlib;print matplotlib"
<module 'matplotlib' from
'/Library/Python/2.6/site-packages/matplotlib/__init__.pyc'>

Johannes

hc

unread,
Jun 9, 2010, 2:07:17 PM6/9/10
to scitools
Johannes:

You are right. I did not use system-provided python 2.6.1. To contrast
to your provided Terminal outputs, I provide mine below:
-----------------------------------------------------------------------------------------------------------------------
Last login: Wed Jun 9 13:35:30 on console
hc-MacBook-Pro:~ hc$ which python
/Library/Frameworks/Python.framework/Versions/2.6/bin/python
hc-MacBook-Pro:~ hc$ python --version
Python 2.6.5
hc-MacBook-Pro:~ hc$ /usr/bin/python -c "import matplotlib;print
matplotlib"
<module 'matplotlib' from '/Library/Python/2.6/site-packages/
matplotlib/__init__.pyc'>
hc-MacBook-Pro:~ hc$
-----------------------------------------------------------------------------------------------------------------------

The system-provided python is no longer in my mac (snow leopard),
after I deleted macports' downloads using macports mannual:
http://guide.macports.org/#installing.macports.uninstalling

Do you know how to fix it?

hc







On Jun 9, 11:04 am, Johannes Ring <joha...@simula.no> wrote:
> OK, so you have installed Python manually and not using system Python?
> I have this:
>
> $ which python
> /usr/bin/python
> $ python --version
> Python 2.6.1
>
> Try to import matplotlib with system Python. I get this:
>
> $ /usr/bin/python -c "import matplotlib;print matplotlib"
> <module 'matplotlib' from
> '/Library/Python/2.6/site-packages/matplotlib/__init__.pyc'>
>
> Johannes
>

Johannes Ring

unread,
Jun 9, 2010, 2:42:27 PM6/9/10
to scit...@googlegroups.com
On Wed, Jun 9, 2010 at 8:07 PM, hc <hwa...@gmail.com> wrote:
> Johannes:
>
> You are right. I did not use system-provided python 2.6.1. To contrast
> to your provided Terminal outputs, I provide mine below:
> -----------------------------------------------------------------------------------------------------------------------
> Last login: Wed Jun  9 13:35:30 on console
> hc-MacBook-Pro:~ hc$ which python
> /Library/Frameworks/Python.framework/Versions/2.6/bin/python
> hc-MacBook-Pro:~ hc$ python --version
> Python 2.6.5
> hc-MacBook-Pro:~ hc$ /usr/bin/python -c "import matplotlib;print
> matplotlib"
> <module 'matplotlib' from '/Library/Python/2.6/site-packages/
> matplotlib/__init__.pyc'>
> hc-MacBook-Pro:~ hc$
> -----------------------------------------------------------------------------------------------------------------------
>
> The system-provided python is no longer in my mac (snow leopard),
> after I deleted macports' downloads using macports mannual:
> http://guide.macports.org/#installing.macports.uninstalling
>
> Do you know how to fix it?

For me it seems like you still have the system provided Python. It
also seems like Matplotlib is installed correctly telling from your
output above. If you don't want to use the system provided Python then
I guess the only option is to build Matplotlib from source. As I said,
I haven't tried this myself on a Mac, but it might be as simple as
"python setup.py build" and then (if everything went fine) "python
setup.py install".

Johannes

hc

unread,
Jun 11, 2010, 2:54:41 PM6/11/10
to scitools
Johannes:

I tried "easy_install matplotlib" and got the following Terminal
messages. But in the end it said "Setup script existed with error:
command gcc-4.0 failed..."

Another try based on your suggestions. I got "configure error: no
acceptable c compiler is found."

I am 100% sure my laptop has gcc installed because xcode was installed
and updated.

Were these problems from some missing paths?

hc

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
bash-3.2$ easy_install matplotlib
Searching for matplotlib
Reading http://pypi.python.org/simple/matplotlib/
Reading http://matplotlib.sourceforge.net
Reading http://sourceforge.net/project/showfiles.php?group_id=80706&package_id=82474
Reading https://sourceforge.net/project/showfiles.php?group_id=80706&package_id=278194
Reading http://sourceforge.net/project/showfiles.php?group_id=80706
Reading https://sourceforge.net/projects/matplotlib/files/matplotlib/matplotlib-0.99.1/
Reading https://sourceforge.net/project/showfiles.php?group_id=80706&package_id=82474
Best match: matplotlib 0.99.3
Downloading http://sourceforge.net/projects/matplotlib/files/matplotlib/matplotlib-0.99.3/matplotlib-0.99.3.tar.gz/download
Processing download
Running matplotlib-0.99.3/setup.py -q bdist_egg --dist-dir /var/
folders/xa/xacrYXTsGAGBqxaUHAjUxE+++TI/-Tmp-/easy_install-h4AcTt/
matplotlib-0.99.3/egg-dist-tmp-oqTKGN
============================================================================
BUILDING MATPLOTLIB
matplotlib: 0.99.3
python: 2.6.5 (r265:79359, Mar 24 2010, 01:32:55)
[GCC
4.0.1 (Apple Inc. build 5493)]
platform: darwin

REQUIRED DEPENDENCIES
numpy: 1.4.1
freetype2: found, but unknown version (no pkg-config)
* WARNING: Could not find 'freetype2' headers
in any
* of '.', './freetype2'.

OPTIONAL BACKEND DEPENDENCIES
libpng: found, but unknown version (no pkg-config)
* Could not find 'libpng' headers in any of
'.'
Tkinter: no
* Tkinter present, but header files are not
found.
* You may need to install development
packages.
wxPython: 2.8.11.0
* WxAgg extension not required for wxPython >=
2.8
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: 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: 8.63
latex: no

[Edit setup.cfg to suppress the above messages]
============================================================================
pymods ['pylab']
packages ['matplotlib', 'matplotlib.backends',
'matplotlib.projections', 'mpl_toolkits', 'mpl_toolkits.mplot3d',
'mpl_toolkits.axes_grid', 'matplotlib.sphinxext',
'matplotlib.numerix', 'matplotlib.numerix.mlab',
'matplotlib.numerix.ma', 'matplotlib.numerix.linear_algebra',
'matplotlib.numerix.random_array', 'matplotlib.numerix.fft',
'matplotlib.delaunay', 'pytz', 'dateutil', 'dateutil/zoneinfo']
warning: no files found matching 'MANIFEST'
warning: no files found matching 'lib/mpl_toolkits'
unable to execute gcc-4.0: No such file or directory
error: Setup script exited with error: command 'gcc-4.0' failed with
exit status 1
bash-3.2$
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

On Jun 9, 2:42 pm, Johannes Ring <joha...@simula.no> wrote:

hc

unread,
Jun 15, 2010, 11:55:28 AM6/15/10
to scitools
Finally, I successfully installed python 2.6.5 + numpy + scipy +
matplotlib + gnuplot + ipython on mac snow leopard. Many thanks for
instructions here.

hc

On Jun 11, 2:54 pm, hc <hwan...@gmail.com> wrote:
> Johannes:
>
> I tried "easy_install matplotlib" and got the following Terminal
> messages. But in the end it said "Setup script existed with error:
> command gcc-4.0 failed..."
>
> Another try based on your suggestions. I got "configure error: no
> acceptable c compiler is found."
>
> I am 100% sure my laptop has gcc installed because xcode was installed
> and updated.
>
> Were these problems from some missing paths?
>
> hc
>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> bash-3.2$ easy_install matplotlib
> Searching for matplotlib
> Readinghttp://pypi.python.org/simple/matplotlib/
> Readinghttp://matplotlib.sourceforge.net
> Readinghttp://sourceforge.net/project/showfiles.php?group_id=80706&package_i...
> Readinghttps://sourceforge.net/project/showfiles.php?group_id=80706&package_...
> Readinghttp://sourceforge.net/project/showfiles.php?group_id=80706
> Readinghttps://sourceforge.net/projects/matplotlib/files/matplotlib/matplotl...
> Readinghttps://sourceforge.net/project/showfiles.php?group_id=80706&package_...
> Best match: matplotlib 0.99.3
> Downloadinghttp://sourceforge.net/projects/matplotlib/files/matplotlib/matplotli...
> ...
>
> read more »
Reply all
Reply to author
Forward
0 new messages