Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to specify include_dir with cythonize? #3014

corydolphin opened this issue Jun 26, 2019 · 0 comments


None yet
1 participant
Copy link

commented Jun 26, 2019


I am trying to use Cython to accelerate some slow, math-heavy code in a large existing project. Since the project doesn't use for dependencies, I would like to use the cythonize command line tool to build the cython binaries. This works well, but I am unable to figure out how to specify an include directory, to e.g. include Numpy header files.

Does anyone have guidance? E.g. to fix this issue:

$ cythonize -a -i **/*.pyx -3

Compiling math-heavy-routines.pyx because it changed.
[1/1] Cythonizing math-heavy-routines.pyx
running build_ext
math-heavy-routines.c:611:10: fatal error: 'numpy/arrayobject.h' file not found
#include "numpy/arrayobject.h"
1 error generated.
error: command 'gcc' failed with exit status 1```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.