[Cython] Cython and Numpy
Dag Sverre Seljebotn
dagss at student.matnat.uio.no
Tue Jun 16 15:08:42 CEST 2009
Dag Sverre Seljebotn wrote:
> Brett Calcott wrote:
>> Hi Daniel,
>>
>>
>> 2009/6/16 Daniel Yarlett <daniel.yarlett at gmail.com>:
>>> ... SNIP ...
>>> It looks like arrayobject.h is not being found, so do I need to modify
>>> my setup.py file somehow? I'm afraid I'm not sure how to do this, so
>>> any help would be greatly appreciated.
>>
>>
>> This line in my .bashrc solves the same problem on my Mac
>>
>> export
>> C_INCLUDE_PATH=/Library/Python/2.5/site-packages/numpy/core/include
>>
>> Or, I think you could add the same path to your definition of the
>> Extension() in setup.py. I think you can do this:
>>
>> ext_modules = [Extension("neuralRoutines", ["neuralRoutines.pyx"],
>> extra_compile_args=['-Ithe/path/you/want/here'],
>> )]
>>
>> ... but I haven't checked it.
>
> The usual way of doing this is
>
> import numpy
> ...
> setup(
> ...
> ext_modules = [Extension(..., include_path=[numpy.get_include()])]
> )
Sorry, that should be include_dirs, not include_path.
--
Dag Sverre
More information about the Cython-dev
mailing list