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
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
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
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
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