Cython: ImportError: No module named 'myModule': how to call a cython module containing a cimport to another cython nodule?
I encounter this problem again in an another project. To solve it, here is what I did:
- all
import
andcimport
statement must be fully qualified - all the python code must be contained in a
rootFolder
- the
setup.py
must be at the same level than therootFolder
- all folder in the
rooFolder
including therootFolder
must contains a__init__.py
- in your
setup.py
the extension'sinclude_dirs
must contains'.'
I created a simple project which illustrates this here.
This page helped me created it.
But my project is simpler and I think it would have helped me a lot if I had it.
My project also illustrate how to automatically build all cython files in a project.
I might be missing something about Cython, but I think it's:
import package.user
user.doSomething()