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

fatal error: numpy/arrayobject.h: No such file or directory #46

Open
ghost opened this issue Dec 27, 2017 · 5 comments
Open

fatal error: numpy/arrayobject.h: No such file or directory #46

ghost opened this issue Dec 27, 2017 · 5 comments

Comments

@ghost
Copy link

ghost commented Dec 27, 2017

when compiling I am getting the following error

fatal error: numpy/arrayobject.h: No such file or directory

Python 2.7 and 3 already installed. Numpy is installed. cython is installed.
using ubuntu 16.04

@lava
Copy link
Owner

lava commented Jan 2, 2018

According to https://packages.ubuntu.com/search?searchon=contents&keywords=numpy%2Farrayobject.h&mode=exactfilename&suite=xenial&arch=any there are three packages for xenial containing this file, if you have installed one of them it should be just a matter of verifying that the include path points to the correct location.

@joelrorseth
Copy link

I'm having the same issue on macOS. I've tried linking with Python 2.7 and 3.6 paths. Doesn't work for either. Using homebrew for my 3.6 install.

@rene-aguirre
Copy link

I'm getting the actual path using this variable in my makefile (fix the python interpreter to python2 or python3 to reflect your installation if needed), OS X Mojave:

NUMPY_INCLUDE := -I$(shell python -c 'import numpy; print(numpy.get_include())')

Also, if using homebrew on Mac OS X try using the python2-config or python3-config script to retrieve --ldflags and --cflags compilation parameters.

Anyway, I'm able to make it work with python2 only (after fixing matplotlibrc backend). I'm having run-time issues when trying to use Python 3.7.x

@asharif
Copy link

asharif commented Dec 13, 2018

if you used pip2 to install numpy then you should need this flag to g++

-I /usr/local/lib/python2.7/site-packages/numpy/core/include/

@XiaoxingChen
Copy link

Same issue, manually find numpy/arrayobject.h at

/usr/local/lib/python3.5/dist-packages/numpy/core/include

Therefore,

set(PYTHON_INCLUDE_DIRS ${PYTHON_INCLUDE_DIRS} /usr/local/lib/python3.5/dist-packages/numpy/core/include)

could be a provisional solution.

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

5 participants