Thank you for your advice.
I followed the advice about installing python from homebrew. I then ran "brew 
doctor" and re-arranged the paths as it told me to. It also gives another list 
of warnings which I'll put at the bottom of this email.

My question is now, what is the best way to install numpy (and scipy, and 
matplotlib), so that it will couple with the brew-installed python?
My earlier dmg install of numpy still doesn't work: (I've tried "python -pylab" 
and just "python" with importing numpy)

kuuki:~ tom$ which python
/usr/local/bin/python
kuuki:~ tom$ ipython -pylab
WARNING: `-pylab` flag has been deprecated.
    Use `--pylab` instead, or `--pylab=foo` to specify a 
backend./Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/IPython/utils/rlineimpl.py:111:
 RuntimeWarning: 
******************************************************************************
libedit detected - readline will not be well behaved, including but not limited 
to:
   * crashes on tab completion
   * incorrect history navigation
   * corrupting long-lines
   * failure to wrap or indent lines properly
It is highly recommended that you install readline, which is easy_installable:
     easy_install readline
Note that `pip install readline` generally DOES NOT WORK, because
it installs to site-packages, which come *after* lib-dynload in sys.path,
where readline is located.  It must be `easy_install readline`, or to a custom
location on your PYTHONPATH (even --user comes after lib-dyload).
******************************************************************************
  RuntimeWarning)
Python 2.7.3 (v2.7.3:70274d53c1dd, Apr  9 2012, 20:52:43) 
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/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/IPython/core/pylabtools.pyc
 in find_gui_and_backend(gui)
    194     """
    195 
--> 196     import matplotlib
    197 
    198     if gui and gui != 'auto':

/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/__init__.py
 in <module>()
    131 import sys, os, tempfile
    132 
--> 133 from matplotlib.rcsetup import (defaultParams,
    134                                 validate_backend,
    135                                 validate_toolbar,

/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/rcsetup.py
 in <module>()
     17 import warnings
     18 from matplotlib.fontconfig_pattern import parse_fontconfig_pattern
---> 19 from matplotlib.colors import is_color_like
     20 
     21 #interactive_bk = ['gtk', 'gtkagg', 'gtkcairo', 'fltkagg', 'qtagg', 
'qt4agg',

/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/colors.py
 in <module>()
     50 """
     51 import re
---> 52 import numpy as np
     53 from numpy import ma
     54 import matplotlib.cbook as cbook

ImportError: No module named numpy

In [1]: 
KeyboardInterrupt

In [1]: ^D
Do you really want to exit ([y]/n)? y
kuuki:~ tom$ python
Python 2.7.3 (default, Jul  5 2012, 08:21:27) 
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy as np
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named numpy
>>> 



And the list of warnings:
kuuki:~ tom$ brew doctor

Error: Some directories in /usr/local/share/man aren't writable.
This can happen if you "sudo make install" software that isn't managed
by Homebrew. If a brew tries to add locale information to one of these
directories, then the install will fail during the link step.
You should probably `chown` them:

    /usr/local/share/man/de
    /usr/local/share/man/de/man1
    /usr/local/share/man/es
    /usr/local/share/man/es/man1
    /usr/local/share/man/fr
    /usr/local/share/man/fr/man1
    /usr/local/share/man/hr
    /usr/local/share/man/hr/man1
    /usr/local/share/man/hu
    /usr/local/share/man/hu/man1
    /usr/local/share/man/it
    /usr/local/share/man/it/man1
    /usr/local/share/man/jp
    /usr/local/share/man/jp/man1
    /usr/local/share/man/pl
    /usr/local/share/man/pl/man1
    /usr/local/share/man/pt_BR
    /usr/local/share/man/pt_BR/man1
    /usr/local/share/man/pt_PT
    /usr/local/share/man/pt_PT/man1
    /usr/local/share/man/ro
    /usr/local/share/man/ro/man1
    /usr/local/share/man/ru
    /usr/local/share/man/ru/man1
    /usr/local/share/man/sk
    /usr/local/share/man/sk/man1
    /usr/local/share/man/zh
    /usr/local/share/man/zh/man1
Error: "config" scripts exist outside your system or Homebrew directories.
`./configure` scripts often look for *-config scripts to determine if
software packages are installed, and what additional flags to use when
compiling and linking.

Having additional scripts in your path can confuse software installed via
Homebrew if the config script overrides a system or Homebrew provided
script of the same name. We found the following "config" scripts:

    /Library/Frameworks/Python.framework/Versions/2.7/bin/python-config
    /Library/Frameworks/Python.framework/Versions/2.7/bin/python2-config
    /Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7-config
    /Library/Frameworks/Python.framework/Versions/2.6/bin/python-config
    /Library/Frameworks/Python.framework/Versions/2.6/bin/python2.6-config
Error: Your Homebrew is outdated
You haven't updated for at least 24 hours, this is a long time in brewland!
Error: Unbrewed dylibs were found in /usr/local/lib.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

Unexpected dylibs:
    /usr/local/lib/libgcc_ext.10.4.dylib    
/usr/local/lib/libgcc_ext.10.5.dylib    /usr/local/lib/libgcc_s.1.dylib    
/usr/local/lib/libgfortran.3.dylib    /usr/local/lib/libgomp.1.dylib    
/usr/local/lib/libmca_common_sm.1.dylib    /usr/local/lib/libmpi.0.dylib    
/usr/local/lib/libmpi_cxx.0.dylib    /usr/local/lib/libmpi_f77.0.dylib    
/usr/local/lib/libopen-pal.0.dylib    /usr/local/lib/libopen-rte.0.dylib    
/usr/local/lib/libssp.0.dylib
Error: Unbrewed .la files were found in /usr/local/lib.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

Unexpected .la files:
    /usr/local/lib/libgfortran.la    /usr/local/lib/libgmp.la    
/usr/local/lib/libgomp.la    /usr/local/lib/libmca_common_sm.la    
/usr/local/lib/libmpc.la    /usr/local/lib/libmpfr.la    
/usr/local/lib/libmpi.la    /usr/local/lib/libmpi_cxx.la    
/usr/local/lib/libmpi_f77.la    /usr/local/lib/libmpi_f90.la    
/usr/local/lib/libopen-pal.la    /usr/local/lib/libopen-rte.la    
/usr/local/lib/libotf.la    /usr/local/lib/libssp.la    
/usr/local/lib/libssp_nonshared.la
Error: Unbrewed static libraries were found in /usr/local/lib.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

Unexpected static libraries:
    /usr/local/lib/libgfortran.a    /usr/local/lib/libgmp.a    
/usr/local/lib/libgomp.a    /usr/local/lib/libiberty.a    
/usr/local/lib/libmpc.a    /usr/local/lib/libmpfr.a    
/usr/local/lib/libmpi_f90.a    /usr/local/lib/libotf.a    
/usr/local/lib/libssp.a    /usr/local/lib/libssp_nonshared.a    
/usr/local/lib/libvt.a    /usr/local/lib/libvt.fmpi.a    
/usr/local/lib/libvt.mpi.a    /usr/local/lib/libvt.omp.a    
/usr/local/lib/libvt.ompi.a
kuuki:~ tom$ brew install numpy
Error: No available formula for numpy 


Some of these unexpected libraries seem to be from my earlier install of 
gfortran and mpi (nothing to do with homebrew).
By the way, there seem to be many versions of python (apple, dmg, homebrew) on 
my macbook.
Thanks again for your help!!

Tom

________________________________
> Date: Wed, 4 Jul 2012 18:44:46 +0200 
> From: ralf.gomm...@googlemail.com 
> To: numpy-discussion@scipy.org 
> Subject: Re: [Numpy-discussion] numpy and readline installation fails 
>  
>  
>  
> On Wed, Jul 4, 2012 at 6:24 PM, Aron Ahmadia  
> <a...@ahmadia.net<mailto:a...@ahmadia.net>> wrote: 
> How do the .dmg files work?  Are these binary installers into the  
> system Python?  I would expect that these wouldn't work with a manually  
> installed Python from python.org<http://python.org>, but I have no  
> experience with them. 
>  
> They're binary installers for the python.org<http://python.org> Python.  
> So they install into /Library/Frameworks/Python.framework/. They don't  
> work with the system (Apple) Python; I think leaving that alone and  
> installing from python.org<http://python.org> is in general good  
> advice. 
>  
>  
> Tom, I have had very good luck with the brew Python 2.7 installer,  
> which will give you a /usr/local Python base install and easy_install.  
>   Brew can also install readline correctly for you. 
>  
> https://github.com/mxcl/homebrew/wiki/Homebrew-and-Python 
>  
> Homebrew appears to be better than MacPorts/Fink, but installing  
> everything from source is not the first advice I'd give to a new user. 
>  
> Ralf 
>  
> If you want an all-in-one solution, you can also grab either the free  
> EPD distribution or another of the "all-in-one" packs. 
>  
> A 
>  
>  
> On Wed, Jul 4, 2012 at 7:03 PM, Paul Anton Letnes  
> <paul.anton.let...@gmail.com<mailto:paul.anton.let...@gmail.com>>  
> wrote: 
> Hello, 
>  
> I don't know exactly what went wrong. I'd start out my debugging by 
> 1) which python # see whether you're running apple's python in  
> /usr/bin/python, or the one you tried to install 
> 2) which easy_install # did you run Apple-python's easy_install, or the  
> one you (tried to) installed? 
> 3) If all of the above match, try running python (not ipython) and try  
> to import numpy. Apple's python ships with numpy (at least the Lion /  
> 10.7 one does). 
> 4) Next, print numpy.__file__ to see whether numpy got installed to  
> where it should 
>  
> In general, I'd advice you to install one package at a time, then test  
> it to see whether it has been installed properly. When you're confident  
> everything is OK, move on to the next package. For instance, test numpy  
> by 
> $ python -c 'import numpy; numpy.test()' 
> and scipy with 
> $ python -c 'import scipy;scipy.test()' 
> (for instance). 
>  
> When you're sure the fundament (python, numpy) is in order, proceed  
> with the house (scipy, matplotlib). 
>  
> Cheers 
> Paul 
>  
>  
> On 4. juli 2012, at 16:16, abc def wrote: 
>  
>  > 
>  > Hello, 
>  > 
>  > I'm new to python and I'd like to learn about numpy / scipy /  
> matplotlib, but I'm having trouble getting started. 
>  > 
>  > I'm following the instructions here: http://www.scipy.org/Getting_Started 
>  > 
>  > First I installed the latest version of python from  
> python.org<http://python.org> by downloading the dmg file, since I read  
> that it doesn't work with apple's installer, and then installed numpy /  
> scipy / matplotlib by downloading the relevent dmg files. 
>  > I then downloaded ipython, ran "easy_install readline" and then ran  
> "python setup.py install". 
>  > 
>  > Then I started ipython with "ipython -pylab" as per the instructions  
> but then I get muliple error messages: 
>  > 
>  > 
>  > 
>  > 
>  > 
>  > $ ipython --pylab 
>  >  
> /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/IPython/utils/rlineimpl.py:111:
>   
> RuntimeWarning: 
>  >  
> ******************************************************************************
>  
>  > libedit detected - readline will not be well behaved, including but  
> not limited to: 
>  >   * crashes on tab completion 
>  >   * incorrect history navigation 
>  >   * corrupting long-lines 
>  >   * failure to wrap or indent lines properly 
>  > It is highly recommended that you install readline, which is  
> easy_installable: 
>  >     easy_install readline 
>  > Note that `pip install readline` generally DOES NOT WORK, because 
>  > it installs to site-packages, which come *after* lib-dynload in sys.path, 
>  > where readline is located.  It must be `easy_install readline`, or to  
> a custom 
>  > location on your PYTHONPATH (even --user comes after lib-dyload). 
>  >  
> ******************************************************************************
>  
>  >  RuntimeWarning) 
>  > Python 2.7.3 (v2.7.3:70274d53c1dd, Apr  9 2012, 20:52:43) 
>  > 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/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/IPython/core/pylabtools.pyc
>   
> in find_gui_and_backend(gui) 
>  >    194     """ 
>  >    195 
>  > --> 196     import matplotlib 
>  >    197 
>  >    198     if gui and gui != 'auto': 
>  > 
>  >  
> /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/__init__.py
>   
> in <module>() 
>  >    131 import sys, os, tempfile 
>  >    132 
>  > --> 133 from matplotlib.rcsetup import (defaultParams, 
>  >    134                                 validate_backend, 
>  >    135                                 validate_toolbar, 
>  > 
>  >  
> /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/rcsetup.py
>   
> in <module>() 
>  >     17 import warnings 
>  >     18 from matplotlib.fontconfig_pattern import parse_fontconfig_pattern 
>  > ---> 19 from matplotlib.colors import is_color_like 
>  >     20 
>  >     21 #interactive_bk = ['gtk', 'gtkagg', 'gtkcairo', 'fltkagg',  
> 'qtagg', 'qt4agg', 
>  > 
>  >  
> /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/colors.py
>   
> in <module>() 
>  >     50 """ 
>  >     51 import re 
>  > ---> 52 import numpy as np 
>  >     53 from numpy import ma 
>  >     54 import matplotlib.cbook as cbook 
>  > 
>  > ImportError: No module named numpy 
>  > 
>  > In [1]: 
>  > 
>  > 
>  > 
>  > 
>  > it seems the installation of numpy and readline didn't work, and  
> there are problems with matplotlib, even though I think I followed all  
> the instructions carefully. 
>  > I can't figure out what I did wrong. Can anybody help? 
>  > 
>  > I'm running mac os 10.6. 
>  > 
>  > Thank you! 
>  > 
>  > Tom 
>  > 
>  > 
>  > 
>  > 
>  > _______________________________________________ 
>  > NumPy-Discussion mailing list 
>  > NumPy-Discussion@scipy.org<mailto:NumPy-Discussion@scipy.org> 
>  > http://mail.scipy.org/mailman/listinfo/numpy-discussion 
>  
> _______________________________________________ 
> NumPy-Discussion mailing list 
> NumPy-Discussion@scipy.org<mailto:NumPy-Discussion@scipy.org> 
> http://mail.scipy.org/mailman/listinfo/numpy-discussion 
>  
>  
> _______________________________________________ 
> NumPy-Discussion mailing list 
> NumPy-Discussion@scipy.org<mailto:NumPy-Discussion@scipy.org> 
> http://mail.scipy.org/mailman/listinfo/numpy-discussion 
>  
>  
>  
> _______________________________________________ NumPy-Discussion  
> mailing list NumPy-Discussion@scipy.org  
> http://mail.scipy.org/mailman/listinfo/numpy-discussion 
                                          
_______________________________________________
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to