[Numpy-discussion] COM/Numeric incompatibility

John Lull lull at acm.org
Sat Oct 21 10:59:20 CDT 2000


(Also posted to comp.lang.python)

(Addendum -- Mark Hammond suggests this may be a threading issue --
OpenDatabase() apparently causes Python threads to be initialized.
Does NumPy or lapack lite use threads for anything?)


I'm working on a Windows application that needs to use both Microsoft
DAO and Numeric, & have run into a problem between the two.  The
following code illustrates the problem:

    from win32com.client import Dispatch
    engine = Dispatch("DAO.DBEngine.35")
    db = engine.OpenDatabase('c:\\test.mdb')

    from Numeric import array
    m = array([[1., 2.], [3., 4.]])
    y = array([2., 1.])
    from LinearAlgebra import linear_least_squares
    print linear_least_squares(m, y)

    print 'success!'

The problem is that the statement 'print linear_...' never completes.
I step through in the debugger under pythonwin, & the lapack routine
called by linear_least_squares() never returns.

If I remove the statement 'db = engine...' it completes normally.

If I make a call to linear_least_squares() *before* the database
stuff, the later call to linear_least_squares() works properly.

test.mdb is an empty database created by Access 97.  Using another
database seems to make no difference.


I am using:
    Python 1.52
    win32all-132
    NumPy 16.1
All are standard distribution builds.

OS is Win98SE.  DAO.DBEngine.35 resolves to DAO350.dll, dated 4/27/98.
That, in turn (I believe) is using msJet35.dll dated 4/23/99.


Any ideas?

Thanks.

Regards,
John




More information about the Numpy-discussion mailing list