Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

setting module import path in cython in the notebook

I want to break up a long chunk of cythonised code in the notebook and put the cython code in my own user directory and then cimport as needed. So I have created a directory and created the MyEi.pxd and MyEi.pyx file. In the notebook cell I have:

''%cython  
#cinclude /home/dad/MyModule/  
import cython  
cimport MyEi  
from MyEi cimport MyEiz''

On running I get:
ImportError: No module named MyEi

Where am I going wrong? I am now totally confused about search paths.

Martin

click to hide/show revision 2
retagged

setting module import path in cython in the notebook

I want to break up a long chunk of cythonised code in the notebook and put the cython code in my own user directory and then cimport as needed. So I have created a directory and created the MyEi.pxd and MyEi.pyx file. In the notebook cell I have:

''%cython  
#cinclude /home/dad/MyModule/  
import cython  
cimport MyEi  
from MyEi cimport MyEiz''

On running I get:
ImportError: No module named MyEi

Where am I going wrong? I am now totally confused about search paths.

Martin