On Jun 7, 11:29 am, Dag Sverre Seljebotn <da...@student.matnat.uio.no>
wrote:
> 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()])]
> )
>


cool.  a little reading / poking around and came up with:

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

tar...@puget:$ cat setup.py
from distutils.core import setup
from distutils.extension import Extension
from Cython.Distutils import build_ext
import numpy

setup(
    cmdclass = {'build_ext': build_ext},
    ext_modules = [Extension("testnumpy",
["testnumpy.pyx"],include_dirs=[numpy.get_include()])]
)

<<<<<<<<<<<<<<<<<<<<<<<<<<<<

and things seem much happier.

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

This sounds like it should be a Trac issue...

I'll put one up unless there's violent opposition... in which case
I'll put up two... its been a slow week :-)

-glenn

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