Error Trying to install numba

I’m trying to install numba pip install numba on a virtual environment using python 3.7, the installation process gave me the next error:

running build_ext
building ‘numba._dynfunc’ extension
Warning: Can’t read registry to find the necessary compiler setting
Make sure that Python modules winreg, win32api or win32con are installed.
C compiler: gcc -pthread -DNDEBUG -O2 -fPIC

creating build/temp.linux-x86_64-3.7
creating build/temp.linux-x86_64-3.7/numba
compile options: ‘-I/opt/pypy3/include -c’
gcc: numba/_dynfuncmod.c
gcc -pthread -shared build/temp.linux-x86_64-3.7/numba/_dynfuncmod.o -o build/lib.linux-x86_64-3.7/numba/_dynfunc.pypy37-pp73-x86_64-linux-gnu.so
building ‘numba._dispatcher’ extension
C compiler: gcc -pthread -DNDEBUG -O2 -fPIC

creating build/temp.linux-x86_64-3.7/numba/core
creating build/temp.linux-x86_64-3.7/numba/core/typeconv
compile options: ‘-I/home/lesz/Documents/Personal-Projects/pypy_test/venv/site-packages/numpy/core/include -I/opt/pypy3/include -c’
gcc: numba/_dispatcher.cpp
gcc: numba/_typeof.c
gcc: numba/_hashtable.c
gcc: numba/core/typeconv/typeconv.cpp
numba/_dispatcher.cpp:20:12: error: ‘Py_tracefunc’ was not declared in this scope
20 | call_trace(Py_tracefunc func, PyObject *obj,
| ^~~~~~~~~~~~
numba/_dispatcher.cpp:20:40: error: expected primary-expression before ‘’ token
20 | call_trace(Py_tracefunc func, PyObject obj,
| ^
numba/_dispatcher.cpp:20:41: error: ‘obj’ was not declared in this scope
20 | call_trace(Py_tracefunc func, PyObject obj,
| ^~~
numba/_dispatcher.cpp:21:26: error: expected primary-expression before ‘
’ token
21 | PyThreadState tstate, PyFrameObject frame,
| ^
numba/_dispatcher.cpp:21:27: error: ‘tstate’ was not declared in this scope; did you mean ‘statx’?
21 | PyThreadState tstate, PyFrameObject *frame,
| ^~~~~~
| statx
numba/_dispatcher.cpp:21:49: error: expected primary-expression before ‘
’ token
21 | PyThreadState tstate, PyFrameObject frame,
| ^
numba/_dispatcher.cpp:21:50: error: ‘frame’ was not declared in this scope; did you mean ‘_frame’?
21 | PyThreadState tstate, PyFrameObject *frame,
| ^~~~~
| _frame
numba/_dispatcher.cpp:22:12: error: expected primary-expression before ‘int’
22 | int what, PyObject arg)
| ^~~
numba/_dispatcher.cpp:22:31: error: expected primary-expression before ‘
’ token
22 | int what, PyObject arg)
| ^
numba/_dispatcher.cpp:22:32: error: ‘arg’ was not declared in this scope
22 | int what, PyObject arg)
| ^~~
numba/_dispatcher.cpp:22:35: error: expression list treated as compound expression in initializer [-fpermissive]
22 | int what, PyObject arg)
| ^
numba/_dispatcher.cpp:37:22: error: ‘Py_tracefunc’ was not declared in this scope
37 | call_trace_protected(Py_tracefunc func, PyObject *obj,
| ^~~~~~~~~~~~
numba/_dispatcher.cpp:37:50: error: expected primary-expression before ‘
’ token
37 | call_trace_protected(Py_tracefunc func, PyObject obj,
| ^
numba/_dispatcher.cpp:37:51: error: ‘obj’ was not declared in this scope
37 | call_trace_protected(Py_tracefunc func, PyObject obj,
| ^~~
numba/_dispatcher.cpp:38:36: error: expected primary-expression before ‘
’ token
38 | PyThreadState tstate, PyFrameObject frame,
| ^
numba/_dispatcher.cpp:38:37: error: ‘tstate’ was not declared in this scope; did you mean ‘statx’?
38 | PyThreadState tstate, PyFrameObject *frame,
| ^~~~~~
| statx
numba/_dispatcher.cpp:38:59: error: expected primary-expression before ‘
’ token
38 | PyThreadState tstate, PyFrameObject frame,
| ^
numba/_dispatcher.cpp:38:60: error: ‘frame’ was not declared in this scope; did you mean ‘_frame’?
38 | PyThreadState tstate, PyFrameObject *frame,
| ^~~~~
| _frame
numba/_dispatcher.cpp:39:22: error: expected primary-expression before ‘int’
39 | int what, PyObject arg)
| ^~~
numba/_dispatcher.cpp:39:41: error: expected primary-expression before ‘
’ token
39 | int what, PyObject arg)
| ^
numba/_dispatcher.cpp:39:42: error: ‘arg’ was not declared in this scope
39 | int what, PyObject arg)
| ^~~
numba/_dispatcher.cpp:39:45: error: expression list treated as compound expression in initializer [-fpermissive]
39 | int what, PyObject arg)
| ^
numba/_dispatcher.cpp: In function ‘PyObject
call_cfunc(Dispatcher
, PyObject
, PyObject
, PyObject
, PyObject
)’:
numba/_dispatcher.cpp:387:17: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘use_tracing’
387 | if (tstate->use_tracing && tstate->c_profilefunc)
| ^~~~~~~~~~~
numba/_dispatcher.cpp:387:40: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘c_profilefunc’
387 | if (tstate->use_tracing && tstate->c_profilefunc)
| ^~~~~~~~~~~~~
numba/_dispatcher.cpp:423:9: error: ‘PyFrame_LocalsToFast’ was not declared in this scope
423 | PyFrame_LocalsToFast(frame, 0);
| ^~~~~~~~~~~~~~~~~~~~
numba/_dispatcher.cpp:424:17: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘frame’
424 | tstate->frame = frame;
| ^~~~~
numba/_dispatcher.cpp:72:24: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘c_profilefunc’
72 | if (call_trace(tstate->c_profilefunc, tstate->c_profileobj,
| ^~~~~~~~~~~~~
numba/_dispatcher.cpp:425:9: note: in expansion of macro ‘C_TRACE’
425 | C_TRACE(result, fn(PyCFunction_GET_SELF(cfunc), args, kws));
| ^~~~~~~
numba/_dispatcher.cpp:72:47: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘c_profileobj’
72 | if (call_trace(tstate->c_profilefunc, tstate->c_profileobj,
| ^~~~~~~~~~~~
numba/_dispatcher.cpp:425:9: note: in expansion of macro ‘C_TRACE’
425 | C_TRACE(result, fn(PyCFunction_GET_SELF(cfunc), args, kws));
| ^~~~~~~
numba/_dispatcher.cpp:73:32: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘frame’
73 | tstate, tstate->frame, PyTrace_CALL, cfunc))
| ^~~~~
numba/_dispatcher.cpp:425:9: note: in expansion of macro ‘C_TRACE’
425 | C_TRACE(result, fn(PyCFunction_GET_SELF(cfunc), args, kws));
| ^~~~~~~
numba/_dispatcher.cpp:73:39: error: ‘PyTrace_CALL’ was not declared in this scope
73 | tstate, tstate->frame, PyTrace_CALL, cfunc))
| ^~~~~~~~~~~~
numba/_dispatcher.cpp:425:9: note: in expansion of macro ‘C_TRACE’
425 | C_TRACE(result, fn(PyCFunction_GET_SELF(cfunc), args, kws));
| ^~~~~~~
numba/_dispatcher.cpp:72:15: error: ‘call_trace’ cannot be used as a function
72 | if (call_trace(tstate->c_profilefunc, tstate->c_profileobj,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
73 | tstate, tstate->frame, PyTrace_CALL, cfunc))
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
numba/_dispatcher.cpp:425:9: note: in expansion of macro ‘C_TRACE’
425 | C_TRACE(result, fn(PyCFunction_GET_SELF(cfunc), args, kws));
| ^~~~~~~
numba/_dispatcher.cpp:78:17: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘c_profilefunc’
78 | if (tstate->c_profilefunc != NULL)
| ^~~~~~~~~~~~~
numba/_dispatcher.cpp:425:9: note: in expansion of macro ‘C_TRACE’
425 | C_TRACE(result, fn(PyCFunction_GET_SELF(cfunc), args, kws));
| ^~~~~~~
numba/_dispatcher.cpp:82:42: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘c_profilefunc’
82 | call_trace_protected(tstate->c_profilefunc,
| ^~~~~~~~~~~~~
numba/_dispatcher.cpp:425:9: note: in expansion of macro ‘C_TRACE’
425 | C_TRACE(result, fn(PyCFunction_GET_SELF(cfunc), args, kws));
| ^~~~~~~
numba/_dispatcher.cpp:83:42: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘c_profileobj’
83 | tstate->c_profileobj,
| ^~~~~~~~~~~~
numba/_dispatcher.cpp:425:9: note: in expansion of macro ‘C_TRACE’
425 | C_TRACE(result, fn(PyCFunction_GET_SELF(cfunc), args, kws));
| ^~~~~~~
numba/_dispatcher.cpp:84:50: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘frame’
84 | tstate, tstate->frame,
| ^~~~~
numba/_dispatcher.cpp:425:9: note: in expansion of macro ‘C_TRACE’
425 | C_TRACE(result, fn(PyCFunction_GET_SELF(cfunc), args, kws));
| ^~~~~~~
numba/_dispatcher.cpp:85:34: error: ‘PyTrace_RETURN’ was not declared in this scope
85 | PyTrace_RETURN, cfunc);
| ^~~~~~~~~~~~~~
numba/_dispatcher.cpp:425:9: note: in expansion of macro ‘C_TRACE’
425 | C_TRACE(result, fn(PyCFunction_GET_SELF(cfunc), args, kws));
| ^~~~~~~
numba/_dispatcher.cpp:82:33: error: ‘call_trace_protected’ cannot be used as a function
82 | call_trace_protected(tstate->c_profilefunc,
| ^~~~~~~~~~~~~
83 | tstate->c_profileobj,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
84 | tstate, tstate->frame,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
85 | PyTrace_RETURN, cfunc);
| ~~~~~~~~~~~~~~~~~~~~~~
numba/_dispatcher.cpp:425:9: note: in expansion of macro ‘C_TRACE’
425 | C_TRACE(result, fn(PyCFunction_GET_SELF(cfunc), args, kws));
| ^~~~~~~
numba/_dispatcher.cpp:90:36: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘c_profilefunc’
90 | if (call_trace(tstate->c_profilefunc,
| ^~~~~~~~~~~~~
numba/_dispatcher.cpp:425:9: note: in expansion of macro ‘C_TRACE’
425 | C_TRACE(result, fn(PyCFunction_GET_SELF(cfunc), args, kws));
| ^~~~~~~
numba/_dispatcher.cpp:91:36: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘c_profileobj’
91 | tstate->c_profileobj,
| ^~~~~~~~~~~~
numba/_dispatcher.cpp:425:9: note: in expansion of macro ‘C_TRACE’
425 | C_TRACE(result, fn(PyCFunction_GET_SELF(cfunc), args, kws));
| ^~~~~~~
numba/_dispatcher.cpp:92:44: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘frame’
92 | tstate, tstate->frame,
| ^~~~~
numba/_dispatcher.cpp:425:9: note: in expansion of macro ‘C_TRACE’
425 | C_TRACE(result, fn(PyCFunction_GET_SELF(cfunc), args, kws));
| ^~~~~~~
numba/_dispatcher.cpp:93:28: error: ‘PyTrace_RETURN’ was not declared in this scope
93 | PyTrace_RETURN, cfunc))
| ^~~~~~~~~~~~~~
numba/_dispatcher.cpp:425:9: note: in expansion of macro ‘C_TRACE’
425 | C_TRACE(result, fn(PyCFunction_GET_SELF(cfunc), args, kws));
| ^~~~~~~
numba/_dispatcher.cpp:90:27: error: ‘call_trace’ cannot be used as a function
90 | if (call_trace(tstate->c_profilefunc,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
91 | tstate->c_profileobj,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
92 | tstate, tstate->frame,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
93 | PyTrace_RETURN, cfunc))
| ~~~~~~~~~~~~~~~~~~~~~~
numba/_dispatcher.cpp:425:9: note: in expansion of macro ‘C_TRACE’
425 | C_TRACE(result, fn(PyCFunction_GET_SELF(cfunc), args, kws));
| ^~~~~~~
numba/_dispatcher.cpp:427:9: error: ‘PyFrame_FastToLocals’ was not declared in this scope
427 | PyFrame_FastToLocals(frame);
| ^~~~~~~~~~~~~~~~~~~~
numba/_dispatcher.cpp:428:17: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘frame’
428 | tstate->frame = frame->f_back;
| ^~~~~
numba/_dispatcher.cpp:428:32: error: ‘PyFrameObject’ {aka ‘struct _frame’} has no member named ‘f_back’
428 | tstate->frame = frame->f_back;
| ^~~~~~
numba/_dispatcher.cpp: In function ‘PyObject
Dispatcher_call(Dispatcher
, PyObject
, PyObject
)’:
numba/_dispatcher.cpp:621:13: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘use_tracing’
621 | if (ts->use_tracing && ts->c_profilefunc) {
| ^~~~~~~~~~~
numba/_dispatcher.cpp:621:32: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘c_profilefunc’
621 | if (ts->use_tracing && ts->c_profilefunc) {
| ^~~~~~~~~~~~~
numba/_dispatcher.cpp: In function ‘PyObject
Dispatcher_cuda_call(Dispatcher
, PyObject
, PyObject
)’:
numba/_dispatcher.cpp:735:13: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘use_tracing’
735 | if (ts->use_tracing && ts->c_profilefunc) {
| ^~~~~~~~~~~
numba/_dispatcher.cpp:735:32: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘c_profilefunc’
735 | if (ts->use_tracing && ts->c_profilefunc) {
| ^~~~~~~~~~~~~
In file included from /opt/pypy3/include/Python.h:122,
from numba/_pymodule.h:6,
from numba/_dispatcher.cpp:1:
numba/_dispatcher.cpp: In function ‘PyObject
call_cfunc(Dispatcher
, PyObject
, PyObject
, PyObject*, PyObject*)’:
/opt/pypy3/include/pystate.h:27:46: warning: control reaches end of non-void function [-Wreturn-type]
27 | #define PyThreadState_GET() PyThreadState_Get()
numba/_dispatcher.cpp:385:14: note: in expansion of macro ‘PyThreadState_GET’
385 | tstate = PyThreadState_GET();
| ^~~~~~~~~~~~~~~~~
error: Command “gcc -pthread -DNDEBUG -O2 -fPIC -I/home/lesz/Documents/Personal-Projects/pypy_test/venv/site-packages/numpy/core/include -I/opt/pypy3/include -c numba/_dispatcher.cpp -o build/temp.linux-x86_64-3.7/numba/_dispatcher.o” failed with exit status 1

ERROR: Failed building wheel for numba
Running setup.py clean for numba
Failed to build numba

I’ve installed llvm and gcc on the system. Anyone could tell me what’s happening?
Thanks a lot!

Hi @LeSZ

Are you trying to build this for pypy? If so, it’s not yet supported, because Numba is quite heavily bound to CPython internals, .

Thanks!! That was the problem, I was trying to install numba for pypy (I don’t know why).