My project has the following directory structure:
.
├── Makefile
├── pxd
├── pyx
│ ├── Landscaping.pyx
│ ├── Shrubbing.pxd
│ └── Shrubbing.pyx
└── setup.py
However, if I move Shrubbing.pxd
anywhere else, say, into pxd/
, I get the following error:
Error compiling Cython file:
------------------------------------------------------------
...
import pyx.Shrubbing
cimport Shrubbing
^
------------------------------------------------------------
pyx/Landscaping.pyx:2:8: 'Shrubbing.pxd' not found
Error compiling Cython file:
------------------------------------------------------------
...
import pyx.Shrubbing
cimport Shrubbing
cdef Shrubbing.Shrubbery sh
^
------------------------------------------------------------
This is strange because in setup.py
I have:
from distutils.core import setup, Extension
from Cython.Build import cythonize
setup(ext_modules=cythonize([
Extension(
'pyx.Landscaping',
sources=["pyx/Landscaping.pyx"],
include_dirs=['pxd']), # <-- HERE
Extension('pyx.Shrubbing', sources=["pyx/Shrubbing.pyx"])
]))
which clearly specifies the new directory for Shrubbing.pxd
.
The source files are all very short, but to avoid cluttering this post, I will just post a link to a repository: https://github.com/lobachevzky/landscaping
Thanks for your help.