question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add a warning about Numba and Python 3.5 compatibility.

See original GitHub issue

The 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:closed
  • Created 3 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
jpivarskicommented, Apr 20, 2020

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.register function) 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.

0reactions
tamasgalcommented, Apr 30, 2020

Thanks Jim!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Add a warning about Numba and Python 3.5 compatibility.
The 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...
Read more >
Installation — Numba 0.50.1 documentation
Compatibility. Numba is compatible with Python 3.6 or later, and Numpy versions 1.15 or later. Our supported platforms are: Linux x86 (32-bit and...
Read more >
Suppressing Deprecation warnings - Numba documentation
However, first is a small section on how to suppress deprecation warnings that may be raised from Numba so as to prevent warnings...
Read more >
PEP 606 – Python Compatibility Version
The new DeprecationWarning and PendingDeprecatingWarning warnings in Python 3.9 will not be disabled in Python 3.8 compatibility mode. If a ...
Read more >
numba
compiling Python code using LLVM. ... pip install numba ... Numba is an open source, NumPy-aware optimizing compiler for Python sponsored by Anaconda, ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found