Ah, that is maybe the idea:
if (_import_array() < 0) {
/* Clear the error state since we are handling the error. */
PyErr_Clear();
/* ... set up for the sans-numpy case. */
}
else {
/* ... set up for the with-numpy case. */
}
I did not call PyErr_Clear() when _import_array() < 0 and t
On Wed, Feb 3, 2010 at 03:41, David Cournapeau wrote:
> On Wed, Feb 3, 2010 at 5:38 PM, Peter Notebaert 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
On Wed, Feb 3, 2010 at 5:38 PM, Peter Notebaert 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
PyMODINIT_FU
>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 wrote:
> Peter Notebaert wrote:
>
> > How can I test if numpy is installed on the system from th
Peter Notebaert wrote:
> How can I test if numpy is installed on the system from the extension so
> that I do not active the numpy functionality and that it is still able
> to use my extension, but then without numpy support?
Is there some reason why you cannot try to import numpy first to chec