mariomulansky/PySpike

Can not install PySpike with python3

Closed this issue · 7 comments

sudo pip install pyspike
running with latest anaconda, using MacOS

   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 pyspike/cython/cython_add.c -o build/temp.macosx-10.7-x86_64-3.7/pyspike/cython/cython_add.o
    In file included from pyspike/cython/cython_add.c:242:
    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:18:
    In file included from /anaconda3/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1823:
    /anaconda3/lib/python3.7/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:15:2: warning: "Using deprecated NumPy API, disable it by "          "#defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-W#warnings]
    #warning "Using deprecated NumPy API, disable it by " \
     ^
    pyspike/cython/cython_add.c:6719: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;}
                                                                                                                                         ^~~~~~~
    pyspike/cython/cython_add.c:7941:134: warning: code will never be executed [-Wunreachable-code]
        __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_1); __Pyx_INCREF(__pyx_t_3); __pyx_t_1++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                                                                                                                                         ^~~~~~~
    pyspike/cython/cython_add.c:9918:138: warning: code will never be executed [-Wunreachable-code]
            __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                                                                                                                                             ^~~~~~~
    pyspike/cython/cython_add.c:9910:137: warning: code will never be executed [-Wunreachable-code]
            __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                                                                                                                                            ^~~~~~~
    pyspike/cython/cython_add.c:13451:138: warning: code will never be executed [-Wunreachable-code]
            __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                                                                                                                                             ^~~~~~~
    pyspike/cython/cython_add.c:13443:137: warning: code will never be executed [-Wunreachable-code]
            __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                                                                                                                                            ^~~~~~~
    pyspike/cython/cython_add.c:14068:138: warning: code will never be executed [-Wunreachable-code]
            __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 704; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                                                                                                                                             ^~~~~~~
    pyspike/cython/cython_add.c:14060:137: warning: code will never be executed [-Wunreachable-code]
            __pyx_t_9 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 704; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                                                                                                                                            ^~~~~~~
    pyspike/cython/cython_add.c:21936:21: error: no member named 'exc_type' in 'struct _ts'
        *type = tstate->exc_type;
                ~~~~~~  ^
    pyspike/cython/cython_add.c:21937: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;
                  ^
    pyspike/cython/cython_add.c:21938: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;
                  ^
    pyspike/cython/cython_add.c:21950:24: error: no member named 'exc_type' in 'struct _ts'
        tmp_type = tstate->exc_type;
                   ~~~~~~  ^
    pyspike/cython/cython_add.c:21951: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;
                  ^
    pyspike/cython/cython_add.c:21952: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;
                  ^
    pyspike/cython/cython_add.c:21953:13: error: no member named 'exc_type' in 'struct _ts'
        tstate->exc_type = type;
        ~~~~~~  ^
    pyspike/cython/cython_add.c:21954: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;
                  ^
    pyspike/cython/cython_add.c:21955: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;
                  ^
    pyspike/cython/cython_add.c:21998:24: error: no member named 'exc_type' in 'struct _ts'
        tmp_type = tstate->exc_type;
                   ~~~~~~  ^
    pyspike/cython/cython_add.c:21999: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;
                  ^
    pyspike/cython/cython_add.c:22000: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;
                  ^
    pyspike/cython/cython_add.c:22001:13: error: no member named 'exc_type' in 'struct _ts'
        tstate->exc_type = local_type;
        ~~~~~~  ^
    pyspike/cython/cython_add.c:22002: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;
                  ^
    pyspike/cython/cython_add.c:22003: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;
                  ^
    pyspike/cython/cython_add.c:22025:24: error: no member named 'exc_type' in 'struct _ts'
        tmp_type = tstate->exc_type;
                   ~~~~~~  ^
    pyspike/cython/cython_add.c:22026: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;
                  ^
    pyspike/cython/cython_add.c:22027: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;
                  ^
    pyspike/cython/cython_add.c:22028:13: error: no member named 'exc_type' in 'struct _ts'
        tstate->exc_type = *type;
        ~~~~~~  ^
    fatal error: too many errors emitted, stopping now [-ferror-limit=]
    9 warnings and 20 errors generated.
    error: command 'gcc' failed with exit status 1

    ----------------------------------------
Command "/anaconda3/bin/python -u -c "import setuptools, tokenize;__file__='/private/tmp/pip-install-hkqb9h4o/pyspike/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-bu7qa1em/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/tmp/pip-install-hkqb9h4o/pyspike/

Thanks

sazio commented

@orena1 I have the same issue, have you solved it in some way ?

Hi guys, from what I could understand this is a problem regarding cython and python 3.7.
I could solve it by installing direct from source (I think that generates new C code with the latest cython).

In other words, do:
1 - Update cython (conda update cython)
2 - Follow these instructions
3 - Comment here and let people know whether it worked.

Same problems with pip install (same errors) here, linux, miniconda3, env with numpy etc. all set up. Installing from source worked.

@gui-miotto solution works

Hello,

I have Python 3.8 with Anaconda, and I have the same problem than in this topic.
I did of course every steps that you adviced. (Maybe the error comes from the Python version?)

Can you help me, please?

Thank you.

This appears to be due to a known incompatibility between numpy and cython versions. See numpy issue #17937 on github.
You should not see it using the latest versions of numpy and cython.
But, if you do, please report that with the numpy and cython versions.

Issue should be resolved (see latest comment by Ed).