[Pyrex] Importing a python module

Greg Ewing greg.ewing at canterbury.ac.nz
Sun Mar 30 22:25:45 CEST 2008


Mathijs Romans wrote:
> the file ./sgf/sgf.pyx starts with:
> 
> import glGo.utils
> 
> The functions in utils.py can't be 
> found during runtime of the binary code.

The 'import' statement in Pyrex works exactly the same way
as it does in Python, i.e. any directory to be used as a
package must have an __init__.py file, and top-level
package directories must be in sys.path or PYTHONPATH,
etc.

All this happens at run time, so the Pyrex compiler
knows nothing about it (as opposed to 'cimport', which
is done at compile time).

-- 
Greg



More information about the Pyrex mailing list