[Pyrex] cimport problems with Python 2.6

Francesc Alted falted at pytables.org
Tue Sep 2 11:22:36 CEST 2008


A Tuesday 02 September 2008, escriguéreu:
> Francesc Alted wrote:
> > from tables.utilsExtension cimport malloc_dims, get_native_type
> >
> > but the error is now:
> >
> > Name 'malloc_dims' not declared in module 'tables.utilsExtension'
>
> This looks like the Pyrex compiler doesn't know that
> 'utilsExtension' belongs to the package 'tables'. It
> needs to know, otherwise various things will go wrong.
>
> The currently recommended way is to lay out your
> source files in a Python-like package directory
> structure with an __init__.py file, e.g.
>
>    tables
>      __init__.py
>      utilsExtension.pxd
>      utilsExtension.pyx
>
> There is more info about this in the Language Overview
> under "Source Files and Compilation".

You are right.  I've converted the file structure to what you are 
suggesting and the problem has gone.

Thanks a lot!

-- 
Francesc Alted



More information about the Pyrex mailing list