[SciPy-user] SciPy on OS X installation problem: ImportError: No module named scipy_distutils

Robert Kern rkern at ucsd.edu
Sun Oct 23 10:12:08 CDT 2005

Michael Williams wrote:
> Hi Robert,
> On 23 Oct 2005, at 14:12, Robert Kern wrote:
>>>I checked SciPy out from SVN around twelve hours ago. When building I
>>>get the following error:
>>>>~/Desktop/scipy mike$ python setup.py build
>>>>Traceback (most recent call last):
>>>> File "setup.py", line 47, in ?
>>>>   import scipy_distutils
>>>>ImportError: No module named scipy_distutils
>>Install the trunk of scipy_core first.
>>  http://svn.scipy.org/svn/scipy_core/trunk/
>>Note, that this is not the scipy_core that we are currently developing
>>as the replacement for Numeric. That development is taking place on a
> Thanks. I get a lot further along now. "python setup.py build && sudo  
> python setup.py install" worked fine on scipy_core.
> I also get what seems like quite a long way through the build process  
> on scipy, before it falls over with the following error:
> /usr/bin/ld: can't locate file for: -lcc_dynamic
> collect2: ld returned 1 exit status
> /usr/bin/ld: can't locate file for: -lcc_dynamic
> collect2: ld returned 1 exit status
> error: Command "/usr/local/bin/g77 -undefined dynamic_lookup -bundle  
> build/temp.darwin-8.2.0-Power_Macintosh-2.4/build/src/Lib/fftpack/ 
> _fftpackmodule.o build/temp.darwin-8.2.0-Power_Macintosh-2.4/Lib/ 
> fftpack/src/zfft.o build/temp.darwin-8.2.0-Power_Macintosh-2.4/Lib/ 
> fftpack/src/drfft.o build/temp.darwin-8.2.0-Power_Macintosh-2.4/Lib/ 
> fftpack/src/zrfft.o build/temp.darwin-8.2.0-Power_Macintosh-2.4/Lib/ 
> fftpack/src/zfftnd.o build/temp.darwin-8.2.0-Power_Macintosh-2.4/ 
> build/src/fortranobject.o -L/usr/local/lib -L/usr/local/lib/gcc/ 
> powerpc-apple-darwin7.9.0/3.4.4 -Lbuild/temp.darwin-8.2.0- 
> Power_Macintosh-2.4 -ldfftpack -lrfftw -lfftw -lg2c -lcc_dynamic -o  
> build/lib.darwin-8.2.0-Power_Macintosh-2.4/scipy/fftpack/_fftpack.so"  
> failed with exit status 1
> Is this is related to the g77 ranlib problem described on the High  
> Performance Computing on OS X page? This says:
> http://hpc.sourceforge.net/
>>Note: You may need to ranlib some libs after you install. The  
>>compiler will tell you which ones when you try to use it. In that  
>>case, simply do a sudo ranlib -s on each such library. On Tiger you  
>>may need to add the flags -lSystemStub -lcc_dynamic for the last  
>>linking step to be successful.
> I have no experience with Fortran or C beyond "Hello, World!", so am  
> left at a loss by this sentence.

That sentence is unrelated to the rest of the paragraph. The GNU FORTRAN
runtime needs some functions which aren't exposed by what g77 normally
links in for dynamic libraries, so you need to manually add -lcc_dynamic.

> Assuming it is the cause of my new  
> problem building SciPy, could someone perhaps explain it to me?

Are you using gcc-4.0? For a variety of reasons, you should use gcc-3.3

  $ sudo gcc_select 3.3

You should then have a file /usr/lib/libcc_dynamic.a .

Robert Kern
rkern at ucsd.edu

"In the fields of hell where the grass grows high
 Are the graves of dreams allowed to die."
  -- Richard Harter

More information about the SciPy-user mailing list