The dmg you are referring to appears to install to
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages
(The main library, not the one for in our user directory). Most likely, this
directory is not in pythons search path. Therefore, python can't find any
modules installed there. To verify this, first check, whether this directory
exists. Then start ipython and enter:
from sys import path
path
Path is a list of all paths which are searched for installed modules. If my
suspicion is correct, the directory where you installed matplotlib is not in
the list. You can just add it
path.append('/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages')
and then import matplotlib. However, you have add it to your path again every
time you start a new session. To add it permanently, put an otherwise empty
text file which includes the path and place it in one of the directories that
are already on the search path. You have add a .pth suffix to this text file
when you save it.
Best,
Felix
ps: There are many ways to install python and packages and all are more
complicated to what you are used to from the mac - welcome to the world of unix
/ linux software... Still, I have been successful using either macports (slow,
but reliable) as well as distribute and pip. I recommend macports which creates
a new installation for everything you want / need in /opt. It can also install
all of the ipython optional dependencies like the qtconsole and the notebook
which cannot be done using pure python package managers.
Am 17.08.2012 um 23:30 schrieb Timothy Duly:
> Hi,
>
> I'm having trouble installing matplotlib on mac os x. I downloaded the dmg
> file (matplotlib-1.1.1-py2.7-python.org-macosx10.6.dmg) from
> http://sourceforge.net/projects/matplotlib/files/matplotlib/matplotlib-1.1.1/
> . I was able to install this package. Beforehand, I installed python from
> python.org (I read about the need to do this rather than use the shipped
> python for mac os x). So, the original python is in /usr/bin/python and the
> other, newer one, is in /usr/local/bin/python.
>
> However, after running "ipython -pylab", I get an error message:
>
> Python 2.7.1 (r271:86832, Aug 5 2011, 03:30:24)
> Type "copyright", "credits" or "license" for more information.
>
> IPython 0.13 -- An enhanced Interactive Python.
> ? -> Introduction and overview of IPython's features.
> %quickref -> Quick reference.
> help -> Python's own help system.
> object? -> Details about 'object', use 'object??' for extra details.
> [TerminalIPythonApp] GUI event loop or pylab initialization failed
> ---------------------------------------------------------------------------
> ImportError Traceback (most recent call last)
> /Library/Python/2.7/site-packages/ipython-0.13-py2.7.egg/IPython/core/pylabtools.pyc
> in find_gui_and_backend(gui)
> 194 """
> 195
> --> 196 import matplotlib
> 197
> 198 if gui and gui != 'auto':
>
> ImportError: No module named matplotlib
>
> It seems that I don't have a module-- but I just installed it?
>
> Side note: I've read to the best of my ability this page here,
> http://matplotlib.sourceforge.net/faq/installing_faq.html#os-x-notes , but
> there seems to be a disconnect on this page between the actual installation
> procedure. For example, no where on this page does it mention about a *.dmg
> file, yet the sourceforge site has the *.dmg file. And this help site
> mentions *.zip files, but this time the sourceforge download page does not
> have any *.zip files! What is going on here?
>
> Thanks,
> Tim
>
>
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and
> threat landscape has changed and how IT managers can respond. Discussions
> will include endpoint security, mobile security and the latest in malware
> threats.
> http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/_______________________________________________
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users