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

'numpy/arrayobject.h' file not found, solved by changing setup.py #2

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

baroobob
Copy link

When I followed the instructions in code/README.md and attempted to compile the model like this:

python setup.py build_ext --inplace

I got this error:

Cythonizing model.pyx
running build_ext
building 'model' extension
clang -fno-strict-aliasing -fno-common -dynamic -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -arch x86_64 -I/usr/local/include -I/usr/local/opt/openssl/include -I/usr/local/opt/sqlite/include -I/usr/local/Cellar/python/2.7.10_2/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c model.c -o build/temp.macosx-10.10-x86_64-2.7/model.o
model.c:265:10: fatal error: 'numpy/arrayobject.h' file not found

include "numpy/arrayobject.h"

^
1 error generated.
error: command 'clang' failed with exit status 1

The word on the street at stackoverflow is that include_dirs sometimes gets ignored in the latest version of distutils, see dashesy's comment here:

http://stackoverflow.com/questions/20333128/cimport-gives-fatal-error-numpy-arrayobject-h-file-not-found

I decided to try using Extension in setup.py to specify include_dirs and it worked! If someone could be so kind as to try this out and confirm it works for them as well then this change should be merged into the repo so others do not have to repeat this debugging process.

Jim Bridgewater added 2 commits September 17, 2015 12:02
to get rid of an error about failing to find numpy/arrayobject.h
to generate model.c and kept Extension to avoid the numpy/arrayobject.h
not found error.
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

Successfully merging this pull request may close these issues.

1 participant