我尝试在macOS Mojave 10.14.6的终端中使用命令sudo pip install bandmat
,并显示:
Installing collected packages: bandmat
Running setup.py install for bandmat ... error
Complete output from command /anaconda3/bin/python -u -c "import setuptools, tokenize;__file__='/private/tmp/pip-install-k1bqybm6/bandmat/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /private/tmp/pip-record-q93hc_of/install-record.txt --single-version-externally-managed --compile:
然后打印完整的输出:
running install
running build
running build_py
creating build
creating build/lib.macosx-10.7-x86_64-3.7
creating build/lib.macosx-10.7-x86_64-3.7/bandmat
copying bandmat/test_tensor.py -> build/lib.macosx-10.7-x86_64-3.7/bandmat
copying bandmat/test_linalg.py -> build/lib.macosx-10.7-x86_64-3.7/bandmat
copying bandmat/test_testhelp.py -> build/lib.macosx-10.7-x86_64-3.7/bandmat
copying bandmat/test_misc.py -> build/lib.macosx-10.7-x86_64-3.7/bandmat
copying bandmat/testhelp.py -> build/lib.macosx-10.7-x86_64-3.7/bandmat
copying bandmat/test_core.py -> build/lib.macosx-10.7-x86_64-3.7/bandmat
copying bandmat/__init__.py -> build/lib.macosx-10.7-x86_64-3.7/bandmat
copying bandmat/test_overlap.py -> build/lib.macosx-10.7-x86_64-3.7/bandmat
copying bandmat/test_full.py -> build/lib.macosx-10.7-x86_64-3.7/bandmat
running build_ext
building 'bandmat.full' extension
creating build/temp.macosx-10.7-x86_64-3.7
creating build/temp.macosx-10.7-x86_64-3.7/bandmat
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/anaconda3/include -arch x86_64 -I/anaconda3/include -arch x86_64 -I/anaconda3/lib/python3.7/site-packages/numpy/core/include -I/anaconda3/include/python3.7m -c bandmat/full.c -o build/temp.macosx-10.7-x86_64-3.7/bandmat/full.o -O3
In file included from bandmat/full.c:239:
In file included from /anaconda3/lib/python3.7/site-packages/numpy/core/include/numpy/arrayobject.h:4:
In file included from /anaconda3/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:12:
In file included from /anaconda3/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1824:
/anaconda3/lib/python3.7/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: "Using deprecated NumPy API, disable it with " "#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-W#warnings]
#warning "Using deprecated NumPy API, disable it with " \
^
bandmat/full.c:1499:46: warning: comparison of integers of different signs: 'unsigned long' and 'long' [-Wsign-compare]
for (__pyx_t_17 = __pyx_t_16; __pyx_t_17 < __pyx_t_13; __pyx_t_17+=1) {
~~~~~~~~~~ ^ ~~~~~~~~~~
bandmat/full.c:1853:37: warning: comparison of integers of different signs: 'unsigned long' and 'long' [-Wsign-compare]
for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
~~~~~~~~~~ ^ ~~~~~~~~~~
bandmat/full.c:1863:37: warning: comparison of integers of different signs: 'unsigned long' and 'long' [-Wsign-compare]
if ((((__pyx_v_j + __pyx_v_i) < __pyx_v_size) != 0)) {
~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~
bandmat/full.c:2131:35: warning: comparison of integers of different signs: 'unsigned long' and 'long' [-Wsign-compare]
for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_2; __pyx_t_5+=1) {
~~~~~~~~~ ^ ~~~~~~~~~
bandmat/full.c:2182:43: warning: comparison of integers of different signs: 'unsigned long' and 'long' [-Wsign-compare]
for (__pyx_t_5 = __pyx_t_9; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
~~~~~~~~~ ^ ~~~~~~~~~
bandmat/full.c:3023:37: warning: comparison of integers of different signs: 'unsigned long' and 'long' [-Wsign-compare]
for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_14; __pyx_t_15+=1) {
~~~~~~~~~~ ^ ~~~~~~~~~~
bandmat/full.c:3033:37: warning: comparison of integers of different signs: 'unsigned long' and 'long' [-Wsign-compare]
if ((((__pyx_v_j - __pyx_v_i) < __pyx_v_size) != 0)) {
~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~
bandmat/full.c:4311:134: warning: code will never be executed [-Wunreachable-code]
__pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
^~~~~~~
bandmat/full.c:7620:28: warning: unused function '__Pyx_PyObject_AsString' [-Wunused-function]
static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) {
^
bandmat/full.c:7617:32: warning: unused function '__Pyx_PyUnicode_FromString' [-Wunused-function]
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
^
bandmat/full.c:7732:33: warning: unused function '__Pyx_PyIndex_AsSsize_t' [-Wunused-function]
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
^
bandmat/full.c:7757:33: warning: unused function '__Pyx_PyInt_FromSize_t' [-Wunused-function]
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
^
bandmat/full.c:7035:36: warning: function '__Pyx_PyInt_As_unsigned_long' is not needed and will not be emitted [-Wunneeded-internal-declaration]
static CYTHON_INLINE unsigned long __Pyx_PyInt_As_unsigned_long(PyObject *x) {
^
bandmat/full.c:7141:48: warning: unused function '__pyx_t_float_complex_from_parts' [-Wunused-function]
static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
^
bandmat/full.c:7151:30: warning: unused function '__Pyx_c_eqf' [-Wunused-function]
static CYTHON_INLINE int __Pyx_c_eqf(__pyx_t_float_complex a, __pyx_t_float_complex b) {
^
bandmat/full.c:7154:48: warning: unused function '__Pyx_c_sumf' [-Wunused-function]
static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sumf(__pyx_t_float_complex a, __pyx_t_float_complex b) {
^
bandmat/full.c:7160:48: warning: unused function '__Pyx_c_difff' [-Wunused-function]
static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_difff(__pyx_t_float_complex a, __pyx_t_float_complex b) {
^
bandmat/full.c:7172:48: warning: unused function '__Pyx_c_quotf' [-Wunused-function]
static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quotf(__pyx_t_float_complex a, __pyx_t_float_complex b) {
^
bandmat/full.c:7179:48: warning: unused function '__Pyx_c_negf' [-Wunused-function]
static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_negf(__pyx_t_float_complex a) {
^
bandmat/full.c:7185:30: warning: unused function '__Pyx_c_is_zerof' [-Wunused-function]
static CYTHON_INLINE int __Pyx_c_is_zerof(__pyx_t_float_complex a) {
^
bandmat/full.c:7188:48: warning: unused function '__Pyx_c_conjf' [-Wunused-function]
static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conjf(__pyx_t_float_complex a) {
^
bandmat/full.c:7202:52: warning: unused function '__Pyx_c_powf' [-Wunused-function]
static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_powf(__pyx_t_float_complex a, __pyx_t_float_complex b) {
^
bandmat/full.c:7261:49: warning: unused function '__pyx_t_double_complex_from_parts' [-Wunused-function]
static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
^
bandmat/full.c:7271:30: warning: unused function '__Pyx_c_eq' [-Wunused-function]
static CYTHON_INLINE int __Pyx_c_eq(__pyx_t_double_complex a, __pyx_t_double_complex b) {
^
bandmat/full.c:7274:49: warning: unused function '__Pyx_c_sum' [-Wunused-function]
static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum(__pyx_t_double_complex a, __pyx_t_double_complex b) {
^
bandmat/full.c:7280:49: warning: unused function '__Pyx_c_diff' [-Wunused-function]
static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff(__pyx_t_double_complex a, __pyx_t_double_complex b) {
^
bandmat/full.c:7292:49: warning: unused function '__Pyx_c_quot' [-Wunused-function]
static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot(__pyx_t_double_complex a, __pyx_t_double_complex b) {
^
bandmat/full.c:7299:49: warning: unused function '__Pyx_c_neg' [-Wunused-function]
static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg(__pyx_t_double_complex a) {
^
bandmat/full.c:7305:30: warning: unused function '__Pyx_c_is_zero' [-Wunused-function]
static CYTHON_INLINE int __Pyx_c_is_zero(__pyx_t_double_complex a) {
^
bandmat/full.c:7308:49: warning: unused function '__Pyx_c_conj' [-Wunused-function]
static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj(__pyx_t_double_complex a) {
^
bandmat/full.c:7322:53: warning: unused function '__Pyx_c_pow' [-Wunused-function]
static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow(__pyx_t_double_complex a, __pyx_t_double_complex b) {
^
bandmat/full.c:4004:32: warning: unused function '__pyx_f_5numpy_PyArray_MultiIterNew1' [-Wunused-function]
static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) {
^
bandmat/full.c:4054:32: warning: unused function '__pyx_f_5numpy_PyArray_MultiIterNew2' [-Wunused-function]
static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
^
bandmat/full.c:4104:32: warning: unused function '__pyx_f_5numpy_PyArray_MultiIterNew3' [-Wunused-function]
static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) {
^
bandmat/full.c:4154:32: warning: unused function '__pyx_f_5numpy_PyArray_MultiIterNew4' [-Wunused-function]
static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d) {
^
bandmat/full.c:4204:32: warning: unused function '__pyx_f_5numpy_PyArray_MultiIterNew5' [-Wunused-function]
static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d, PyObject *__pyx_v_e) {
^
bandmat/full.c:4967:27: warning: unused function '__pyx_f_5numpy_set_array_base' [-Wunused-function]
static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
^
bandmat/full.c:5055:32: warning: unused function '__pyx_f_5numpy_get_array_base' [-Wunused-function]
static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
^
39 warnings generated.
gcc -bundle -undefined dynamic_lookup -L/anaconda3/lib -arch x86_64 -L/anaconda3/lib -arch x86_64 -arch x86_64 build/temp.macosx-10.7-x86_64-3.7/bandmat/full.o -o build/lib.macosx-10.7-x86_64-3.7/bandmat/full.cpython-37m-darwin.so
building 'bandmat.core' extension
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/anaconda3/include -arch x86_64 -I/anaconda3/include -arch x86_64 -I/anaconda3/lib/python3.7/site-packages/numpy/core/include -I/anaconda3/include/python3.7m -c bandmat/core.c -o build/temp.macosx-10.7-x86_64-3.7/bandmat/core.o -O3
In file included from bandmat/core.c:239:
In file included from /anaconda3/lib/python3.7/site-packages/numpy/core/include/numpy/arrayobject.h:4:
In file included from /anaconda3/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:12:
In file included from /anaconda3/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1824:
/anaconda3/lib/python3.7/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: "Using deprecated NumPy API, disable it with " "#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-W#warnings]
#warning "Using deprecated NumPy API, disable it with " \
^
bandmat/core.c:4088:46: warning: comparison of integers of different signs: 'unsigned long' and 'long' [-Wsign-compare]
for (__pyx_t_15 = __pyx_t_14; __pyx_t_15 < __pyx_t_9; __pyx_t_15+=1) {
~~~~~~~~~~ ^ ~~~~~~~~~
bandmat/core.c:10536:136: warning: code will never be executed [-Wunreachable-code]
__pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_6); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 675; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
^~~~~~~
bandmat/core.c:10499:136: warning: code will never be executed [-Wunreachable-code]
__pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_6); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 674; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
^~~~~~~
bandmat/core.c:10463:136: warning: code will never be executed [-Wunreachable-code]
__pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_6); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
^~~~~~~
bandmat/core.c:12052:134: warning: code will never be executed [-Wunreachable-code]
__pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
^~~~~~~
bandmat/core.c:15606:21: error: no member named 'exc_type' in 'struct _ts'
*type = tstate->exc_type;
~~~~~~ ^
bandmat/core.c:15607:22: error: no member named 'exc_value' in 'struct _ts'; did you mean 'curexc_value'?
*value = tstate->exc_value;
^~~~~~~~~
curexc_value
/anaconda3/include/python3.7m/pystate.h:240:15: note: 'curexc_value' declared here
PyObject *curexc_value;
^
bandmat/core.c:15608:19: error: no member named 'exc_traceback' in 'struct _ts'; did you mean 'curexc_traceback'?
*tb = tstate->exc_traceback;
^~~~~~~~~~~~~
curexc_traceback
/anaconda3/include/python3.7m/pystate.h:241:15: note: 'curexc_traceback' declared here
PyObject *curexc_traceback;
^
bandmat/core.c:15620:24: error: no member named 'exc_type' in 'struct _ts'
tmp_type = tstate->exc_type;
~~~~~~ ^
bandmat/core.c:15621:25: error: no member named 'exc_value' in 'struct _ts'; did you mean 'curexc_value'?
tmp_value = tstate->exc_value;
^~~~~~~~~
curexc_value
/anaconda3/include/python3.7m/pystate.h:240:15: note: 'curexc_value' declared here
PyObject *curexc_value;
^
bandmat/core.c:15622:22: error: no member named 'exc_traceback' in 'struct _ts'; did you mean 'curexc_traceback'?
tmp_tb = tstate->exc_traceback;
^~~~~~~~~~~~~
curexc_traceback
/anaconda3/include/python3.7m/pystate.h:241:15: note: 'curexc_traceback' declared here
PyObject *curexc_traceback;
^
bandmat/core.c:15623:13: error: no member named 'exc_type' in 'struct _ts'
tstate->exc_type = type;
~~~~~~ ^
bandmat/core.c:15624:13: error: no member named 'exc_value' in 'struct _ts'; did you mean 'curexc_value'?
tstate->exc_value = value;
^~~~~~~~~
curexc_value
/anaconda3/include/python3.7m/pystate.h:240:15: note: 'curexc_value' declared here
PyObject *curexc_value;
^
bandmat/core.c:15625:13: error: no member named 'exc_traceback' in 'struct _ts'; did you mean 'curexc_traceback'?
tstate->exc_traceback = tb;
^~~~~~~~~~~~~
curexc_traceback
/anaconda3/include/python3.7m/pystate.h:241:15: note: 'curexc_traceback' declared here
PyObject *curexc_traceback;
^
bandmat/core.c:15668:24: error: no member named 'exc_type' in 'struct _ts'
tmp_type = tstate->exc_type;
~~~~~~ ^
bandmat/core.c:15669:25: error: no member named 'exc_value' in 'struct _ts'; did you mean 'curexc_value'?
tmp_value = tstate->exc_value;
^~~~~~~~~
curexc_value
/anaconda3/include/python3.7m/pystate.h:240:15: note: 'curexc_value' declared here
PyObject *curexc_value;
^
bandmat/core.c:15670:22: error: no member named 'exc_traceback' in 'struct _ts'; did you mean 'curexc_traceback'?
tmp_tb = tstate->exc_traceback;
^~~~~~~~~~~~~
curexc_traceback
/anaconda3/include/python3.7m/pystate.h:241:15: note: 'curexc_traceback' declared here
PyObject *curexc_traceback;
^
bandmat/core.c:15671:13: error: no member named 'exc_type' in 'struct _ts'
tstate->exc_type = local_type;
~~~~~~ ^
bandmat/core.c:15672:13: error: no member named 'exc_value' in 'struct _ts'; did you mean 'curexc_value'?
tstate->exc_value = local_value;
^~~~~~~~~
curexc_value
/anaconda3/include/python3.7m/pystate.h:240:15: note: 'curexc_value' declared here
PyObject *curexc_value;
^
bandmat/core.c:15673:13: error: no member named 'exc_traceback' in 'struct _ts'; did you mean 'curexc_traceback'?
tstate->exc_traceback = local_tb;
^~~~~~~~~~~~~
curexc_traceback
/anaconda3/include/python3.7m/pystate.h:241:15: note: 'curexc_traceback' declared here
PyObject *curexc_traceback;
^
然后显示错误:
6 warnings and 15 errors generated.
error: command 'gcc' failed with exit status 1
----------------------------------------
Command "/anaconda3/bin/python -u -c "import setuptools, tokenize;__file__='/private/tmp/pip-install-iisequ8k/bandmat/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /private/tmp/pip-record-czzey623/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/tmp/pip-install-iisequ8k/bandmat/
我以前使用过sudo pip install,它使用了setup.py,而我所见过的类似问题的解决方案是关于安装python-dev以获取python标头文件的,尽管我知道我拥有python .h文件位于
-I/anaconda3/include/python3.7m
。
我也尝试过运行sudo installer -pkg /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg -target /
,但这并不能解决问题。