[Pyrex] cimport problems with Python 2.6

Greg Ewing greg.ewing at canterbury.ac.nz
Tue Sep 2 03:54:03 CEST 2008


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

-- 
Greg



> [other subsequent error lines clipped]
> 
> I'm using Pyrex 0.9.8.5 and Python 2.6b3 in a Linux box.
> 
> If you want, you can access the SVN branch of the affected code from:
> 
> http://pytables.org/svn/pytables/trunk
> 
> Thanks in advance,
> 




More information about the Pyrex mailing list