[Numpy-discussion] Python 2.6 and numpy 1.3.0/1.4.0 from an extension

2010-02-08 Thread Peter Notebaert
I have made an extension that also uses numpy. I developed with Python 2.6 and numpy 1.4.0 This works all fine. The problem is that users that use this extension get crahes from the moment they use the extension and this because of numpy. It crashes when numpy is initialised. This because those

Re: [Numpy-discussion] Determine if numpy is installed from an extension

2010-02-03 Thread Peter Notebaert
From an extension? How to import numpy from there and then test if that succeeded and that without any annoying message if possible... Thanks, Peter On Wed, Feb 3, 2010 at 1:34 AM, David Cournapeau da...@silveregg.co.jpwrote: Peter Notebaert wrote: How can I test if numpy is installed

Re: [Numpy-discussion] Determine if numpy is installed from an extension

2010-02-03 Thread Peter Notebaert
PM, Peter Notebaert p...@telenet.be wrote: From an extension? How to import numpy from there and then test if that succeeded and that without any annoying message if possible... One obvious solution would be to simply call PyImport_Import, something like: #include Python.h

Re: [Numpy-discussion] Determine if numpy is installed from anextension

2010-02-03 Thread Peter Notebaert
tests and the return value indicates if ok or not. So I only had to call PyErr_Clear(); when it failes and the problem is solved. Thanks for your input. Peter From: Peter Notebaert Sent: Wednesday, February 03, 2010 16:57 To: Discussion of Numerical Python Subject: Re: [Numpy-discussion

[Numpy-discussion] Determine if numpy is installed from an extension

2010-02-02 Thread Peter Notebaert
Hello, I have written a C-extension for python that uses arrays from python, does calculations on them and returns a result on that. I have now also added the possibility to provide numpy arrays. However this is not a requirement. Python arrays (lists) are still allowed also. I check in the