Running python3 script results in numba error - Python numba

from clifford.g3 import *
from numpy import e,pi
a = e1 + 2*e2 + 3*e3
R = e**(pi/4*e12)

x =  R*a*~R
Traceback (most recent call last):
  File "C:\Users\Rob\clifford\test.py", line 1, in <module>
    from clifford.g3 import *
  File "C:\Users\Rob\AppData\Local\Programs\Python\Python38-32\lib\site-packages\clifford\g3.py", line 2, in <module>
    layout, blades = Cl(3)
  File "C:\Users\Rob\AppData\Local\Programs\Python\Python38-32\lib\site-packages\clifford\__init__.py", line 733, in Cl
    layout = Layout._from_Cl(p, q, r, firstIdx=firstIdx, names=names)
  File "C:\Users\Rob\AppData\Local\Programs\Python\Python38-32\lib\site-packages\clifford\_layout.py", line 163, in _from_Cl
    return cls._from_sig([0]*r + [+1]*p + [-1]*q, **kwargs)
  File "C:\Users\Rob\AppData\Local\Programs\Python\Python38-32\lib\site-packages\clifford\_layout.py", line 158, in _from_sig
    return cls(sig, bladeTupList, firstIdx=firstIdx, **kwargs)
  File "C:\Users\Rob\AppData\Local\Programs\Python\Python38-32\lib\site-packages\clifford\_layout.py", line 146, in __init__
    self._genTables()
  File "C:\Users\Rob\AppData\Local\Programs\Python\Python38-32\lib\site-packages\clifford\_layout.py", line 307, in _genTables
    self.gmt, imt_prod_mask, omt_prod_mask, lcmt_prod_mask = construct_tables(
  File "C:\Users\Rob\AppData\Local\Programs\Python\Python38-32\lib\site-packages\clifford\__init__.py", line 146, in construct_tables
    indices, *arrs = _numba_construct_tables(
  File "C:\Users\Rob\AppData\Local\Programs\Python\Python38-32\lib\site-packages\numba\dispatcher.py", line 395, in _compile_for_args
    raise e
  File "C:\Users\Rob\AppData\Local\Programs\Python\Python38-32\lib\site-packages\numba\dispatcher.py", line 352, in _compile_for_args
    return self.compile(tuple(argtypes))
  File "C:\Users\Rob\AppData\Local\Programs\Python\Python38-32\lib\site-packages\numba\compiler_lock.py", line 32, in _acquire_compile_lock
    return func(*args, **kwargs)
  File "C:\Users\Rob\AppData\Local\Programs\Python\Python38-32\lib\site-packages\numba\dispatcher.py", line 693, in compile
    cres = self._compiler.compile(args, return_type)
  File "C:\Users\Rob\AppData\Local\Programs\Python\Python38-32\lib\site-packages\numba\dispatcher.py", line 76, in compile
    status, retval = self._compile_cached(args, return_type)
  File "C:\Users\Rob\AppData\Local\Programs\Python\Python38-32\lib\site-packages\numba\dispatcher.py", line 90, in _compile_cached
    retval = self._compile_core(args, return_type)
  File "C:\Users\Rob\AppData\Local\Programs\Python\Python38-32\lib\site-packages\numba\dispatcher.py", line 103, in _compile_core
    cres = compiler.compile_extra(self.targetdescr.typing_context,
  File "C:\Users\Rob\AppData\Local\Programs\Python\Python38-32\lib\site-packages\numba\compiler.py", line 972, in compile_extra
    return pipeline.compile_extra(func)
  File "C:\Users\Rob\AppData\Local\Programs\Python\Python38-32\lib\site-packages\numba\compiler.py", line 390, in compile_extra
    return self._compile_bytecode()
  File "C:\Users\Rob\AppData\Local\Programs\Python\Python38-32\lib\site-packages\numba\compiler.py", line 903, in _compile_bytecode
    return self._compile_core()
  File "C:\Users\Rob\AppData\Local\Programs\Python\Python38-32\lib\site-packages\numba\compiler.py", line 890, in _compile_core
    res = pm.run(self.status)
  File "C:\Users\Rob\AppData\Local\Programs\Python\Python38-32\lib\site-packages\numba\compiler_lock.py", line 32, in _acquire_compile_lock
    return func(*args, **kwargs)
  File "C:\Users\Rob\AppData\Local\Programs\Python\Python38-32\lib\site-packages\numba\compiler.py", line 266, in run
    raise patched_exception
  File "C:\Users\Rob\AppData\Local\Programs\Python\Python38-32\lib\site-packages\numba\compiler.py", line 257, in run
    stage()
  File "C:\Users\Rob\AppData\Local\Programs\Python\Python38-32\lib\site-packages\numba\compiler.py", line 764, in stage_nopython_backend
    self._backend(lowerfn, objectmode=False)
  File "C:\Users\Rob\AppData\Local\Programs\Python\Python38-32\lib\site-packages\numba\compiler.py", line 703, in _backend
    lowered = lowerfn()
  File "C:\Users\Rob\AppData\Local\Programs\Python\Python38-32\lib\site-packages\numba\compiler.py", line 682, in backend_nopython_mode
    return native_lowering_stage(
  File "C:\Users\Rob\AppData\Local\Programs\Python\Python38-32\lib\site-packages\numba\compiler.py", line 1143, in native_lowering_stage
    lower.lower()
  File "C:\Users\Rob\AppData\Local\Programs\Python\Python38-32\lib\site-packages\numba\lowering.py", line 177, in lower
    self.lower_normal_function(self.fndesc)
  File "C:\Users\Rob\AppData\Local\Programs\Python\Python38-32\lib\site-packages\numba\lowering.py", line 218, in lower_normal_function
    entry_block_tail = self.lower_function_body()
  File "C:\Users\Rob\AppData\Local\Programs\Python\Python38-32\lib\site-packages\numba\lowering.py", line 243, in lower_function_body
    self.lower_block(block)
  File "C:\Users\Rob\AppData\Local\Programs\Python\Python38-32\lib\site-packages\numba\lowering.py", line 258, in lower_block
    self.lower_inst(inst)
  File "C:\Users\Rob\AppData\Local\Programs\Python\Python38-32\lib\site-packages\numba\lowering.py", line 410, in lower_inst
    func(self, inst)
  File "C:\Users\Rob\AppData\Local\Programs\Python\Python38-32\lib\site-packages\numba\npyufunc\parfor.py", line 51, in _lower_parfor_parallel
    ensure_parallel_support()
  File "C:\Users\Rob\AppData\Local\Programs\Python\Python38-32\lib\site-packages\numba\parfor.py", line 3985, in ensure_parallel_support
    raise errors.UnsupportedParforsError(msg)
numba.errors.UnsupportedParforsError: Failed in nopython mode pipeline (step: nopython mode backend)
The 'parallel' target is not currently supported on Windows operating systems when using Python 2.7, or on 32 bit hardware.
[1] During: lowering "id=0[LoopNest(index_variable = parfor_index.32, range = (0, $const0.12, 1)), LoopNest(index_variable = parfor_index.33, range = (0, $array_length.65, 1))]{327: <ir.Block at C:\Users\Rob\AppData\Local\Programs\Python\Python38-32\lib\site-packages\clifford\__init__.py (100)>}Var($parfor_index_tuple_var.39, C:\Users\Rob\AppData\Local\Programs\Python\Python38-32\lib\site-packages\clifford\__init__.py (100))" at C:\Users\Rob\AppData\Local\Programs\Python\Python38-32\lib\site-packages\clifford\__init__.py (100)
-------------------------------------------------------------------------------
This should not have happened, a problem has occurred in Numba's internals.
You are currently using Numba version 0.45.1.

Please report the error message and traceback, along with a minimal reproducer
at: https://github.com/numba/numba/issues/new

If more help is needed please feel free to speak to the Numba core developers
directly at: https://gitter.im/numba/numba

Thanks in advance for your help in improving Numba!
Asked Oct 12 '21 00:10
avatar RobJagt
RobJagt

8 Answer:

Thanks for the report. It looks like you are trying to use the parallel target on an supported target, from the error message:

The 'parallel' target is not currently supported on Windows operating systems when using Python 2.7, or on 32 bit hardware.

is this the case?

Also, Numba 0.47 is the first version of Numba to support Python 3.8.

1
Answered Jan 24 '20 at 13:50
avatar  of stuartarchibald
stuartarchibald

Thanks for quick reply.

I downloaded a new python version i.e. 3.6. on a 64-bit computer.

I still get an error when executing: from cliford.g3 import *

The root error seems to be in llvmlite\ir\instructions.py, line 84 in init

Raise TypeError(msg)

TypeError: Type of #4 arg mismatch: i1 != i32

Numba version = 0.45.1

Do you recognize this?

Best regards

Rob

Van: stuartarchibald [mailto:notifications@github.com] Verzonden: vrijdag 24 januari 2020 14:50 Aan: numba/numba numba@noreply.github.com CC: RobJagt rob.jagt@hetnet.nl; Author author@noreply.github.com Onderwerp: Re: [numba/numba] Running python3 script results in numba error (#5138)

Thanks for the report. It looks like you are trying to use the parallel target on an supported target, from the error message:

The 'parallel' target is not currently supported on Windows operating systems when using Python 2.7, or on 32 bit hardware.

is this the case?

Also, Numba 0.47 is the first version of Numba to support Python 3.8.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/numba/numba/issues/5138?email_source=notifications&email_token=AOLYFNZC3JEFDHTNCTGRJ63Q7LW2FA5CNFSM4KLGAESKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEJ22YPA#issuecomment-578137148 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AOLYFN2X2NRJVXUVSANKEX3Q7LW2FANCNFSM4KLGAESA . https://github.com/notifications/beacon/AOLYFN4DSUZPLD6IVP3TWPDQ7LW2FA5CNFSM4KLGAESKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEJ22YPA.gif

1
Answered Jan 25 '20 at 12:21
avatar  of RobJagt
RobJagt

@RobJagt thanks for submitting this to the Numba issue tracker. I have updated your submission to include syntax highlighting. For future reference triple backticks are needed around a code block (with optional language syntax specified), for example: ```python <your code> ```. GitHub also has a basic guide to its markdown syntax available here.

1
Answered Jan 27 '20 at 10:36
avatar  of esc
esc

@RobJagt the error you are seeing now, TypeError: Type of #4 arg mismatch: i1 != i32 may be related to a Numba and llvmlite mismatch. Maybe you could attempt to install both libraries at their latest versions. For Numba that is 0.47.0 and for llvmlite this is 0.31.0?

1
Answered Jan 27 '20 at 10:39
avatar  of esc
esc

Hi, thx for reply

When loading the cliifford pacakge, both numba and llvmlite (amongst other modules) where installed.

I upgraded the numba version to 0.47.0 but got an error message that clifford (version 1.2.0) requires numba version 0.45.1

For llvmlite the required version is 0.31.0

Although there was an error during upgrade, numba version 0.47.0 was installed.

After that, the code runs successfully now.

It seems that there is a ‘problem’ with the installation of clifford package.

Thanks a lot for the help!!

Best regards,

Rob

Van: Valentin Haenel [mailto:notifications@github.com] Verzonden: maandag 27 januari 2020 11:40 Aan: numba/numba numba@noreply.github.com CC: RobJagt rob.jagt@hetnet.nl; Mention mention@noreply.github.com Onderwerp: Re: [numba/numba] Running python3 script results in numba error (#5138)

@RobJagt https://github.com/RobJagt the error you are seeing now, TypeError: Type of #4 arg mismatch: i1 != i32 may be related to a Numba and llvmlite mismatch. Maybe you could attempt to install both libraries at their latest versions. For Numba that is 0.47.0 and for llvmlite this is 0.31.0?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/numba/numba/issues/5138?email_source=notifications&email_token=AOLYFN5AOJQZ5HK2IACYTE3Q722WPA5CNFSM4KLGAESKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEJ7BORQ#issuecomment-578688838 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AOLYFN5IGRO5RP6V4UV6C23Q722WPANCNFSM4KLGAESA . https://github.com/notifications/beacon/AOLYFN6DN7MQFQAG363NWQDQ722WPA5CNFSM4KLGAESKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEJ7BORQ.gif

1
Answered Jan 27 '20 at 19:10
avatar  of RobJagt
RobJagt

@RobJagt thanks for reporting back on this, I will close the issue for now. If you hit any further snags, please don't hesitate to get in touch.

But cc @hugohadfield and @eric-wieser (developers of clifford) just in case.

1
Answered Jan 27 '20 at 19:34
avatar  of esc
esc

Thanks for the heads up, I thought we had unpinned the old numba version in our releases, perhaps not! Will have a look and check..

1
Answered Jan 27 '20 at 19:38
avatar  of hugohadfield
hugohadfield

I think the promble is the version the python.I used the version 3.7.5 and it showed the promble like you.Then I changed the version from 3.7.5 to 3.8.5 and it worder!

1
Answered Jul 26 '21 at 06:00
avatar  of chanliangsheng
chanliangsheng