Open benwu7 opened 8 years ago
change to this seems to work.
return cythonize(cython_srcs, include_dirs=[numpy.get_include()])
Also need to run python setup.py build_ext --inplace and then run python setup.py --without-cuda install
@benwu7 I changed return cythonize(cython_srcs, include_dirs=[numpy.get_include()])
and then python setup.py build_ext --inplace
or python setup.py --without-cuda install
still have the same error message. Anything else I need to do?
I solved the problem by the following steps.
First, in python, import numpy
and numpy.get_include()
to get the numpy source file location, which is /usr/local/lib/python2.7/site-packages/numpy/core/include/numpy
in my case.
Then, copy the directory to global include directory by cp -r /usr/local/lib/python2.7/site-packages/numpy/core/include/numpy /usr/local/include
.
Then it works with python setup.py install
.
Thank you anyway.
Alternatively to copying the contents of the numpy source file location, you can create a symlink like so (from within /usr/local/include):
ln -s /usr/local/lib/python2.7/site-packages/numpy/core/include/numpy numpy
another simple solution: https://github.com/andersbll/cudarray/issues/52
I recommend @bashia solution
@bashia 's solution is good for me. Great!
The following worked for me
export CFLAGS=-I/usr/local/lib/python2.7/site-packages/numpy/core/include/ python setup.py build
I solved the problem by the following steps.
First, in python,
import numpy
andnumpy.get_include()
to get the numpy source file location, which is/usr/local/lib/python2.7/site-packages/numpy/core/include/numpy
in my case.Then, copy the directory to global include directory by
cp -r /usr/local/lib/python2.7/site-packages/numpy/core/include/numpy /usr/local/include
.Then it works with
python setup.py install
.Thank you anyway.
Thank You So much for posting the solution. I got the same error in installing Faiss. Was able to surpass it by copying the dir(numpy.get_include()) to /usr/include
include_dirs passed to setup() gets ignored in the latest distutils, it has to be passed to each Extension, (at least on mac)
extensions = [
Extension("my_ext", ["my_ext.pyx"], include_dirs=[numpy.get_include()])
]
setup(
name='my_ext',
ext_modules=cythonize(extensions),
script_args = ["build_ext", "--inplace"]
)
I solved the problem by the following steps.
First, in python,
import numpy
andnumpy.get_include()
to get the numpy source file location, which is/usr/local/lib/python2.7/site-packages/numpy/core/include/numpy
in my case.Then, copy the directory to global include directory by
cp -r /usr/local/lib/python2.7/site-packages/numpy/core/include/numpy /usr/local/include
.Then it works with
python setup.py install
.Thank you so much. This worked for me.
I ran setup.py without cuda.
getting error:
I think this is a setup.py issue. I do see
is used. I do see people talk about similar issue in https://www.reddit.com/r/MachineLearning/comments/2lv8n3/cudabased_neural_networks_in_python/cpjm44c but I followed "python setup.py build_ext --inplace" and get the same error.