I am trying to access the new parallel features of Cython 0.15 (using
Cython 0.15.1). However, if I try this minimal example (testp.py), taken
from [1],
> from cython.parallel import prange, parallel, threadid
>
> cdef int i
> cdef int sum = 0
>
> for i in prange(n, nogil=True):
> sum += i
>
> print sum
with this setup.py,
> from distutils.core import setup
> from distutils.extension import Extension
> from Cython.Distutils import build_ext
> import numpy
>
> ext = Extension("testp", ["testp.pyx"],
include_dirs=[numpy.get_include()],
> extra_compile_args=['-fopenmp'], extra_link_args
['-fopenmp'])
>
> setup(ext_modules=[ext], cmdclass={'build_ext': build_ext})
when I "import testp" Python tells me: "ImportError: No module named
parallel". And in fact, if I browse the Cython package in the
site-packages, I cannot find any file or directory that is called
"parallel". But I thought it should be included somewhere in the
release? Could someone please clarify for a confused user?
Thanks a lot, Daniel Jung
Your code should work if you type 'n' as an int, but you should not
get such errors. I think you might be importing a different Cython
installation. Try confirming it by printing Cython.__file__ and
Cython.__version__.
Thanks! Daniel Jung
On Dec 5, 6:26 pm, mark florisson <markflorisso...@gmail.com> wrote: