[Pyrex] major cimport problems

Stefan Behnel stefan_ml at behnel.de
Tue Nov 20 11:23:17 CET 2007


David McNab wrote:
> I notice that cimport works fine if all modules are at the top level, in
> other words, not living at different parts of a package tree.
> 
> However, I'm trying to build up a package tree as follows:
> 
>   dvedit/
>     __init__.py
>     core.so
>     filters/
>       inverse.so
>       flip.so
>       ...
> 
> In other words, I need to create the following modules:
> 
>   dvedit.core
>   dvedit.filters.inverse
>   dvedit.filters.flip
>   ...
> 
> And, all the 'dvedit.filters.*' modules need to 'cimport' some defs from
> core.pxd.
> 
> How should I set up my distutils script, such that:
>  1. pyrex compilation of all the 'filters' modules succeeds
>  2. importing of the filters modules succeeds?

Did you name your source files according to their fully qualified package
names? Such as "dvedit.filters.inverse.pyx" ?

http://www.cosc.canterbury.ac.nz/greg.ewing/python/Pyrex/version/Doc/Manual/source_files.html

Stefan




More information about the Pyrex mailing list