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

[PATCH] fatal error: numpy/arrayobject.h: No such file or director #1

Open
npinto opened this issue Jul 21, 2012 · 0 comments
Open

Comments

@npinto
Copy link

npinto commented Jul 21, 2012

% python setup.py build_ext                                                                                                                                                                                                                                                                                         running build_ext
skipping 'pydeconv/utils.c' Cython extension (up-to-date)
building 'pydeconv.utils' extension
C compiler: x86_64-pc-linux-gnu-gcc -pthread -fPIC

compile options: '-I/usr/include/python2.7 -c'
x86_64-pc-linux-gnu-gcc: pydeconv/utils.c
pydeconv/utils.c:275:31: fatal error: numpy/arrayobject.h: No such file or directory
compilation terminated.
pydeconv/utils.c:275:31: fatal error: numpy/arrayobject.h: No such file or directory
compilation terminated.
error: Command "x86_64-pc-linux-gnu-gcc -pthread -fPIC -I/usr/include/python2.7 -c pydeconv/utils.c -o build/temp.linux-x86_64-2.7/pydeconv/utils.o" failed with exit status 1

The following patch fixes the issue:

diff --git a/setup.py b/setup.py
index 2a4cb41..ca53743 100644
--- a/setup.py
+++ b/setup.py
@@ -3,9 +3,11 @@
 from distutils.core import setup
 from distutils.extension import Extension
 from Cython.Distutils import build_ext
+from numpy.distutils.misc_util import get_numpy_include_dirs

 ext_modules = [
     Extension("pydeconv.utils", ["pydeconv/utils.pyx"],
+    include_dirs=get_numpy_include_dirs(),
     ),
 ]

HTH

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant