【发布时间】:2015-03-10 10:18:57
【问题描述】:
我正在尝试使用 python2.7 在 Ubuntu 上安装一个名为 mlabwrap-1.1 的 python 包。但是,安装失败并报告:
error: command 'gcc' failed with exit status 1
注意:不久前我更新了 numpy 并收到了一堆警告,但我不知道这是否与它有关。
那么可能是什么问题?
一些细节
Linux 版本 3.2.0-49-generic (buildd@komainu) (gcc 版本 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5) ) #75-Ubuntu SMP Tue Jun 18 17:39:32 UTC 2013
我得到的确切错误:
[r@b ~/local/mlabwrap-1.1]$ sudo python setup.py install
running install
running build
running build_py
running build_ext
building 'mlabrawmodule' extension
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -D_V6_5_OR_LATER=1 -I/usr/local/matlab/extern/include -I/usr/local/lib/python2.7/dist-packages/numpy-1.9.2-py2.7-linux-x86_64.egg/numpy/core/include -I/usr/include/python2.7 -c mlabraw.cpp -o build/temp.linux-x86_64-2.7/mlabraw.o
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for Ada/C/ObjC but not for C++ [enabled by default]
In file included from /usr/local/lib/python2.7/dist-packages/numpy-1.9.2-py2.7-linux-x86_64.egg/numpy/core/include/numpy/ndarraytypes.h:1804:0,
from /usr/local/lib/python2.7/dist-packages/numpy-1.9.2-py2.7-linux-x86_64.egg/numpy/core/include/numpy/ndarrayobject.h:17,
from /usr/local/lib/python2.7/dist-packages/numpy-1.9.2-py2.7-linux-x86_64.egg/numpy/core/include/numpy/arrayobject.h:4,
from mlabraw.cpp:136:
/usr/local/lib/python2.7/dist-packages/numpy-1.9.2-py2.7-linux-x86_64.egg/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]
mlabraw.cpp: In function ‘PyArrayObject* mx2numeric(const mxArray*)’:
mlabraw.cpp:225:34: error: cannot convert ‘const mwSize* {aka const long unsigned int*}’ to ‘const int*’ in assignment
mlabraw.cpp: In function ‘mxArray* makeMxFromNumeric(const PyArrayObject*)’:
mlabraw.cpp:365:93: error: cannot convert ‘int*’ to ‘const mwSize* {aka const long unsigned int*}’ for argument ‘2’ to ‘mxArray* mxCreateNumericArray(mwSize, const mwSize*, mxClassID, mxComplexity)’
mlabraw.cpp: In function ‘mxArray* numeric2mx(PyObject*)’:
mlabraw.cpp:509:54: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
mlabraw.cpp: In function ‘PyObject* mlabraw_open(PyObject*, PyObject*)’:
mlabraw.cpp:570:16: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
mlabraw.cpp: In function ‘PyObject* mlabraw_eval(PyObject*, PyObject*)’:
mlabraw.cpp:631:15: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
mlabraw.cpp:662:66: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
mlabraw.cpp: In function ‘void initmlabraw()’:
mlabraw.cpp:895:65: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
error: command 'gcc' failed with exit status 1
【问题讨论】:
标签: python gcc numpy installation