ederwander / PyAutoTune

Autotune Module for Python "PyAutoTune"
141 stars 20 forks source link

fatal error: 'numpy/arrayobject.h' file not found #4

Closed alien35 closed 5 years ago

alien35 commented 6 years ago

running python setup.py install returns the following error:

running build
running build_ext
building 'AutoTune' extension
gcc -fno-strict-aliasing -I/Users/alexanderleon/miniconda3/include -arch x86_64 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/alexanderleon/miniconda3/include/python2.7 -c PyAutoTuner.c -o build/temp.macosx-10.5-x86_64-2.7/PyAutoTuner.o
PyAutoTuner.c:21:10: fatal error: 'numpy/arrayobject.h' file not found
#include <numpy/arrayobject.h>
         ^~~~~~~~~~~~~~~~~~~~~
1 error generated.
error: command 'gcc' failed with exit status 1

numpy version: 1.15 python: 2.7.8 c compiler: Can run make or gcc without a problem

ederwander commented 6 years ago

You maybe need find the path for the numpy/arrayobject.h...

I'm using windows, so inside my C:\Python27\Lib\distutils I use the file distutils.cfg to tell what is my compiler and where are all my includes:

In linux the idstutils.cfg can be create in/usr/lib/python2.7/distutils/

distutils.cfg:

[build]
compiler=mingw32

[build_ext]
include_dirs= C:\Python27\Lib\site-packages\numpy\core\include

in linux this can be: include_dirs=/usr/local/lib/python2.7/site-packages/numpy/core/include

or

include_dirs=/usr/lib/python2.7/site-packages/numpy/core/include

My Python version is:

C:\Python27>python
Python 2.7 (r27:82525, Jul  4 2010, 09:01:59) [MSC v.1500 32 bit (Intel)] on win
32

My Numpy Version

C:\Python27>python -c "import numpy; print(numpy.__version__)"
1.6.2
schanq commented 5 years ago

export CFLAGS="-I /usr/local/lib/python2.7/site-packages/numpy/core/include $CFLAGS"