[SciPy-dev] crash with 'import scipy.linalg' and 'import scipy.io'

John Pye john@curioussymbols....
Thu Mar 8 17:53:36 CST 2007


Hi Ravi

Thanks for the reply, and I'm pleased to hear that you've had success
with what I'm trying to do. Did that backtrace mean anything to you?

The only other place numpy is used in my code is in the highest-level,
which is a python GUI written on top of my SWIG-wrapped C library. The
latest thing is that I have attempted to make some python callbacks from
*plugins* in the low-level C code, which, being plugins, didn't have
access to all the SWIG wrappings. So numpy is being imported twice but
in different 'frames'. I bet that something scipy/numpy is assuming with
regard to global variables is what's falling over. Other modules have
imported OK: sys, io, subprocess. Just not scipy.io or scipy.linalg.

Here is the code where python gets launched in the plugin:
https://pse.cheme.cmu.edu/svn-view/ascend/code/branches/extfn/models/johnpye/extpy/extpy.c?rev=1267&view=markup

For the moment, I have been able to work around the problem by instead
using a subprocess to do the scipy work, but it's not ideal. If you had
any further thoughts that would be great.

Cheers
JP

Ravikiran Rajagopal wrote:

> > On Wednesday 07 March 2007 11:50:14 pm John Pye wrote:
> >   
>   
>> >> Perhaps it's a categorical "you can't use scipy in embedded python". But
>> >> hopefully not.
>> >>     
>>     
> >
> > That is not the case. I have been using scipy in embedded python (in embedded 
> > ipython!) for a while now to provide a scripting interface to my SystemC 
> > code. It uses matplotlib to plot stuff, and I have not had any issues with it 
> > for a long time. I am not doing exactly what you seem to be doing since I am 
> > combining all of the pieces of code using boost.python.
> >
> > Regarding your specific problem, it is hard to say without looking at the 
> > code. Did you import numpy in your C code prior to importing it in python 
> > code? If so, did you call import_array?
> >
> > Regards,
> > Ravi
> >
> >
> > _______________________________________________
> > Scipy-dev mailing list
> > Scipy-dev@scipy.org
> > http://projects.scipy.org/mailman/listinfo/scipy-dev
> >   
>   



More information about the Scipy-dev mailing list