
(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

(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?)
No.
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.
I don't know how dynamic libraries work under Windows, but I could imagine that your database modules uses a symbol which is also used in Linpack or the Linpack/Python interface. There ought to be tools to verify this. Konrad. -- ------------------------------------------------------------------------------- Konrad Hinsen | E-Mail: hinsen@cnrs-orleans.fr Centre de Biophysique Moleculaire (CNRS) | Tel.: +33-2.38.25.56.24 Rue Charles Sadron | Fax: +33-2.38.63.15.17 45071 Orleans Cedex 2 | Deutsch/Esperanto/English/ France | Nederlands/Francais -------------------------------------------------------------------------------
participants (2)
-
John Lull
-
Konrad Hinsen