Add a warning about Numba and Python 3.5 compatibility.
See original GitHub issueThe problem I encountered is that numba.core.typing is not present e.g. in numba v0.47 which is the latest for Python 3.5.
I found the corresponding commit: https://github.com/scikit-hep/awkward-1.0/commit/3df1e14622cdc1f7561914252f19f5b39ffde2ae
This was probably not caught by the awkward1 test suite. Here is the error which came up in my library:
venv/lib/python3.5/site-packages/awkward1/_connect/_numba/__init__.py:10: in register
import awkward1._connect._numba.arrayview
venv/lib/python3.5/site-packages/awkward1/_connect/_numba/arrayview.py:9: in <module>
import numba.core.typing
E ImportError: No module named 'numba.core'
I thought making a PR which replaces import numba.core.typing with import numba.typing etc. (in _connect/_numba/arrayview.py and _connect/_numba/builder.py) would solve the problem but apparently numba.typing.ctypes does not exist in 0.47, which is also used:
In [1]: import numba.typing
In [2]: numba.typing.ctypes_utils
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-2-d7a62042b95a> in <module>
----> 1 numba.typing.ctypes_utils
AttributeError: module 'numba.typing' has no attribute 'ctypes_utils'
In [3]: numba.__version__
Out[3]: '0.47.0'
What works is:
In [1]: from numba.typing import ctypes_utils
This on the other hand will not work for numba 0.50+
In [1]: from numba.typing import ctypes_utils
/usr/local/bin/ipython:1: NumbaDeprecationWarning: An import was requested from a module that has moved location.
Import of 'ctypes_utils' requested from: 'numba.typing', please update to use 'numba.core.typing' or pin to Numba version 0.48.0. This alias will not be present in Numba version 0.50.0.
#!/usr/local/bin/python
What do you think about some special code for Python 3.5 (ImportError catches or version check blocks and alike)?
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (3 by maintainers)

Top Related StackOverflow Question
I changed the name of this issue because what I plan to do with this is to make Awkward complain on entry (the
awkward1._connect._numba.registerfunction) if the Numba version is less than 0.49, which would always be true for Python 3.5.It won’t complain on import (so that the mere existence of an old Numba doesn’t break Awkward), but when you attempt to use an array in a Numba function.
Thanks Jim!