[SciPy-user] Re: Problems Installing SciPy on OS X 10.4.2 w/python 2.3.5

David Shupe shupe at ipac.caltech.edu
Mon Oct 3 12:03:39 EDT 2005


On Sep 30, 2005, at 10:37 AM, scipy-user-request at scipy.net wrote:
>
> Message: 6
> Date: Fri, 30 Sep 2005 09:44:06 -0700
> From: Zane Crawford <zane-scipy at ideotrope.org>
> Subject: [SciPy-user] Problems Installing SciPy on OS X 10.4.2 w/
>     python    2.3.5
> To: scipy-user at scipy.net
> Message-ID: <20050930164406.GA1688 at ideotrope.org>
> Content-Type: text/plain; charset=us-ascii
>
> With much frustration, and some patient help from Chris Fonnesbeck, I
> have been trying to get SciPy installed on my Mac.
>
> I am running OS X 10.4.2, and am attempting to use the stock python
> (2.3.5) which is installed by the Apple developer tools.  I believe I
> have all of the underlying dependencies installed and functioning
> (Numeric 24.0b2, AquaTerm 1.0b2, fftw, GnuPlot 4.0.0, F2PY, and  
> probably
> other things I installed along the way), and am now running into
> problems with the actual build of SciPy itself.  I have just tried  
> three
> different ways:
>
> 1) I installed a binary package which Chris created for me, built  
> on python
>    2.3.5.  It installs fine, and I can "import scipy" without issues,
>    however, I can't use anything from it, because of the  
> __cvs_version__
>    bug, which is referred to in the mailing list archives, but  
> which was
>    apparently not fixed in a persistent way. (it seems there was some
>    clever code which allowed the software to keep track of its own
>    version based on the CVS versions of the files, but this became
>    broken when the source was migrated to SVN?)
>
> 2) I tried to build the last CVS version of SciPy, from July 29th,
>    2005.  This fails almost immediately, regardless of whether I'm  
> using
>    GCC 3.3 or GCC 4.0, with an error from posixpath.py, line 77:
>    i = p.rfind('/') + 1
>    AttributeError: 'NoneType' object has no attribute 'rfind'
>
> 3) I tried pulling the most recent version of the source from SVN.   
> This
>    seems to get much further than the CVS build, but fails eventually:
>
>    In file included from Lib/xplt/src/play/all/hash0.c:8:
>    build/temp.darwin-8.2.0-Power_Macintosh-2.3/config_pygist/ 
> config.h:3:3:
>    #error destroy this config.h and rerun configure script
>
>    However, there are many many warnings prior to this failure, and I
>    don't know what the acutal problem is
>
> I've completely removed (as far as I can tell) all installed SciPy
> packages (from Chris' build) and think I have a clean 2.3.5 python
> environment ready to install SciPy.  If anyone has any other sources
> they would recommend building from, I'm happy to try.  My initial
> attempt to install SciPy (prior to this mess) was via Fink, which  
> seemed
> to result in its own problems.
>
> -- 
> Zane A. Crawford        .    +    zane at ideotrope.org
> Amateur Human        *   ,     *  https://ideotrope.org
> Boulder, Colorado        __o
> work : 303.735.3729    _`\<,_    "Here we are, trapped in the
> cell : 303.815.6866   (*)/ (*)    amber of the moment. There
> PGP  : 0x55E0815F                 is no why."

I was able to install SciPy from svn last Thursday (Sep 29) on a new  
system with OS X 10.4.2 and XCode 2.  I didn't use the stock Python  
because it doesn't have readline support.  I wanted to have  
matplotlib and IPython in addition to SciPy, and couldn't get  
matplotlib working using Fink.  If you are willing to use a different  
Python, here are the steps I followed:

- From http://undefined.org/python/ install MacPython 2.4.1 and  
TigerPython24Fix.
Then set PATH to use /usr/local/bin first.

- From http://pythonmac.org/packages/ install these packages:
     Numeric
     numarray
     wxPython
     matplotlib

- Using fink, install atlas and fftw3.

- In the svn checkout of the scipy trunk, set up site.cfg to find the  
Atlas and FFTw3 libraries.  Here's the relevant snippet of my site.cfg:
[DEFAULT]
# library_dirs = /usr/local/lib:/opt/lib:/usr/lib
# include_dirs = /usr/local/include:/opt/include:/usr/include
# src_dirs = /usr/local/src:/opt/src
library_dirs = /usr/local/lib:/usr/lib:/sw/lib
include_dirs = /usr/local/include:/usr/include:/sw/include

# Search static libraries (.a) in preference to shared ones (.so,.sl):
# XXX: will be removed in future unless proved to be useful
search_static_first = 1

[atlas]
# system_info.py searches atlas and lapack from the following paths
#   library_dir:DEFAULT/atlas*:DEFAULT/ATLAS*:DEFAULT
# where DEFAULT refers to library_dir defined in [DEFAULT] section and
#library_dirs = /usr/lib/3dnow      # Debian Sid

# For overriding the names of the atlas libraries:
# atlas_libs = lapack, f77blas, cblas, atlas

[lapack]
# library_dirs = ..

[lapack_src]
# src_dirs = ..

[blas]
# library_dirs = ..

[fftw]
#fftw_libs = fftw, rfftw
#fftw_opt_libs = fftw_threaded, rfftw_threaded
# if the above aren't found, look for {s,d}fftw_libs and {s,d} 
fftw_opt_libs

[x11]
library_dirs = /usr/X11R6/lib
include_dirs = /usr/X11R6/include

- Then build scipy_core and scipy.  My first build of scipy failed  
with a message about the loader not finding a flag "cc_dynamic".  I  
commented out lines 107 and 108 in the scipy_distutils/ 
gnufcompiler.py file:
~/soft/scipy/scipy_core/scipy_distutils> diff gnufcompiler.py  
gnufcompiler.py.bak
107,108c107,108
<         #if sys.platform == 'darwin':
<         #    opt.append('cc_dynamic')
---
 >         if sys.platform == 'darwin':
 >             opt.append('cc_dynamic')

Then my second build worked great!  scipy.test() runs cleanly.  To  
use matplotlib, I start my sessions using /usr/local/bin/pythonw.

This was much easier than my previous attempts to build scipy on  
Solaris!

Hope this helps,
David Shupe
Spitzer Science Center, Caltech




More information about the SciPy-User mailing list