Failed to "python setup.py install" in Ubuntu system
DIMPLY opened this issue · 1 comments
DIMPLY commented
I got a lot of Warnings and finally exited with error. The output was very long and the last part of it is:
In file included from /home/yeon/.local/lib/python2.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1821:0,
from /home/yeon/.local/lib/python2.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:18,
from /home/yeon/.local/lib/python2.7/site-packages/numpy/core/include/numpy/arrayobject.h:4,
from sklearn/neighbors/quad_tree.c:259:
/home/yeon/.local/lib/python2.7/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:15:2: warning: #warning "Using deprecated NumPy API, disable it by " "#defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]
#warning "Using deprecated NumPy API, disable it by " \
^~~~~~~
sklearn/neighbors/quad_tree.c:2424:1: warning: function declaration isn???t a prototype [-Wstrict-prototypes]
static PyObject *__pyx_pf_7sklearn_9neighbors_9quad_tree_9_QuadTree_16test_summarize(); /* proto */
^~~~~~
sklearn/neighbors/quad_tree.c: In function ???__pyx_f_7sklearn_9neighbors_9quad_tree_9_QuadTree_insert_point???:
sklearn/neighbors/quad_tree.c:3582:14: error: format not a string literal and no format arguments [-Werror=format-security]
printf(__pyx_k_QuadTree_found_a_duplicate);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sklearn/neighbors/quad_tree.c: In function ???__pyx_f_7sklearn_9neighbors_9quad_tree_9_QuadTree__get_cell_ndarray???:
sklearn/neighbors/quad_tree.c:6643:36: warning: passing argument 1 of ???(PyObject * (*)(PyTypeObject *, PyArray_Descr *, int, npy_intp *, npy_intp *, void *, int, PyObject *))*(PyArray_API + 752)??? from incompatible pointer type [-Wincompatible-pointer-types]
__pyx_t_2 = PyArray_NewFromDescr(((PyObject *)__pyx_ptype_5numpy_ndarray), ((PyArray_Descr *)__pyx_t_1), 1, __pyx_v_shape, __pyx_v_strides, ((void *)__pyx_v_self->cells), NPY_DEFAULT, Py_None); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
^
sklearn/neighbors/quad_tree.c:6643:36: note: expected ???PyTypeObject * {aka struct _typeobject *}??? but argument is of type ???PyObject * {aka struct _object *}???
sklearn/neighbors/quad_tree.c: At top level:
sklearn/neighbors/quad_tree.c:7074:18: warning: function declaration isn???t a prototype [-Wstrict-prototypes]
static PyObject *__pyx_pf_7sklearn_9neighbors_9quad_tree_9_QuadTree_16test_summarize() {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
error: Setup script exited with error: Command "x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-l1RrwO/python2.7-2.7.14=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/home/yeon/.local/lib/python2.7/site-packages/numpy/core/include -I/home/yeon/.local/lib/python2.7/site-packages/numpy/core/include -I/usr/include/python2.7 -c sklearn/neighbors/quad_tree.c -o build/temp.linux-x86_64-2.7/sklearn/neighbors/quad_tree.o -MMD -MF build/temp.linux-x86_64-2.7/sklearn/neighbors/quad_tree.o.d" failed with exit status 1```
Deleted user commented
It has been solved. I ran python setup.py build
before install.