I'm trying to compile the following c++ file
#include <iostream>
#include <Python.h>
#include <numpy/npy_math.h>
using namespace std;
int main()
{
cout << "Hello World" << endl; // prints value of i
}
with the following
clang++ main.cpp -std=c++1y
It returns: main.cpp:3:10: fatal error: 'Python.h' file not found
Then I found this solution Python.h header file missing on Mac OS X 10.6 then I change the file into
#include <iostream>
#include <Python/Python.h>
#include <numpy/npy_math.h>
using namespace std;
int main()
{
cout << "Hello World" << endl; // prints value of i
}
It works, but second problem comes out: main.cpp:3:10: fatal error: 'numpy/npy_math.h' file not found
Ok, then I find the path of numpy and
clang++ main.cpp -std=c++1y -I /Users/nicolas/opt/anaconda3/lib/python3.7/site-packages/numpy/core/include
then, it returns
/Users/nicolas/opt/anaconda3/lib/python3.7/site-packages/numpy/core/include/numpy/npy_common.h:11:10: fatal error: 'Python.h' file not found #include <Python.h>
Can anyone help me?