Glenn Tarbox, PhD wrote:
> setup.py is pulled directly from the cython tutorial docs:
>
> tar...@puget:$ cat setup.py
> from distutils.core import setup
> from distutils.extension import Extension
> from Cython.Distutils import build_ext
>
> setup(
>     cmdclass = {'build_ext': build_ext},
>     ext_modules = [Extension("testnumpy", ["testnumpy.pyx"])]
> )
>
> The numpy include directories were problematic previously (an extra 
> "core" directory level recently introduced) although Trac indicates 
> that issue was fixed and I'm "pretty sure" I first saw the include 
> problem in the notebook which doesn't occur.
Note that that setup.py doesn't include NumPy headers, which are usually 
needed if numpy is cimported. Please do

import numpy
...
setup(
   ...
   ext_modules = [Extension(..., include_path=[numpy.get_include()])]
)

The problems remain with the notebook though -- Cython, NumPy and the 
Sage notebook does not work out of the box last time I tried. (It's been 
a while since I tried it, but the problems didn't seem restricted to 
only include path problems, but also some conflicts between the 
preparsing/inserting include statements and the cimport of numpy? But 
don't trust my memory here.)

Dag Sverre

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-devel@googlegroups.com
To unsubscribe from this group, send email to 
sage-devel-unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to