[SciPy-User] scipy.linalg.det TypeError

Norm Wood nbwood@lamar.colostate....
Wed Oct 28 14:07:01 CDT 2009


I'm trying to use the scipy code for kernel density estimation and am
running into a problem with the calculation of a determinant.  In
scipy/linalg/basic.py, the determinant code has a couple of lines:

fdet, = get_flinalg_funcs(('det',),(a1,))
a_det,info = fdet(a1,overwrite_a=overwrite_a)

These are at lines 484 and 485 in the scipy 0.7.1 basic.py source file.

Execution of the second line produces a TypeError:
  TypeError:  'NoneType' object is not callable

I expect this means that the first line failed to "get" the linalg
function called 'det'.

I'd appreciate any suggestions about why this is happening.  The odd
thing is that the numpy routine for calculating a determinant works
fine.  Here's simple code that shows the problem:

#!/usr/bin/env /usr/bin/python

import numpy
import scipy.linalg
import numpy.linalg

A = numpy.matrix([[1.1, 1.9],[1.9,3.5]])
#This works fine
y = numpy.linalg.det(A)
#This throws a TypeError
y = scipy.linalg.det(A)

I'm using LAPACK 3.1.1, Atlas 3.8.0, numpy 1.2.1, and I've tried both
scipy 0.7.0 and 0.7.1, all built with gcc 3.3.6 & g77.

Platform is Linux (Slackware 10.2), kernel 2.4.31.
Python is version 2.4.1, built with gcc 3.3.5

Here's the Atlas build info:
ATLAS version 3.8.0 built by norm on Thu Dec  6 17:18:59 MST 2007:
   UNAME    : Linux wombat 2.4.31-1 #1 SMP Wed Dec 7 16:52:41 MST 2005 i686 unknown unknown GNU/Linux
   INSTFLG  : -1 0 -a 1
   F2CDEFS  : -DAdd__ -DF77_INTEGER=int -DStringSunStyle
   CACHEEDGE: 524288
   F77      : g77, version GNU Fortran (GCC) 3.3.6
   F77FLAGS : -O -m32
   SMC      : gcc, version gcc (GCC) 3.3.6
   SMCFLAGS : -fomit-frame-pointer -mfpmath=387 -O2 -falign-loops=4 -m32
   SKC      : gcc, version gcc (GCC) 3.3.6
   SKCFLAGS : -fomit-frame-pointer -mfpmath=387 -O2 -falign-loops=4 -m32

The output of numpy/distutils/system_info.py is pretty long.  If there's
particular information from that which would be useful, I'll be glad to
send it, but it looks to me as if numpy and scipy are using the same
atlas libraries.  Here's the atlas_info from system_info.py

  libraries f77blas,cblas,atlas not found in /usr/local/lib
  libraries lapack_atlas not found in /usr/local/lib
  libraries lapack_atlas not found in /home/norm/lusr/lib
    libraries = ['lapack', 'f77blas', 'cblas', 'atlas']
    library_dirs = ['/home/norm/lusr/lib']
    language = f77
    include_dirs = ['/home/norm/lusr/include']

And here's the atlas_blas_info from the scipy build:

  libraries f77blas,cblas,atlas not found in /usr/local/lib
    libraries = ['f77blas', 'cblas', 'atlas']
    library_dirs = ['/home/norm/lusr/lib']
    language = c
    include_dirs = ['/home/norm/lusr/include']

Thanks for any suggestions.


More information about the SciPy-User mailing list