hyriver/py3dep

Error in compiling

Magic-IP opened this issue · 3 comments

What happened?

Get an error at
import py3dep

What did you expect to happen?

No response

Minimal Complete Verifiable Example

No response

MVCE confirmation

  • Minimal example — the example is as focused as reasonably possible to demonstrate the underlying issue.
  • Complete example — the example is self-contained, including all data and the text of any traceback.
  • New issue — a search of GitHub Issues suggests this is not a duplicate.

Relevant log output

raceback (most recent call last):
  File "C:\Users\arahmatmand\Anaconda3_5\envs\pvlibdev\lib\site-packages\numba\core\errors.py", line 823, in new_error_context
    yield
  File "C:\Users\arahmatmand\Anaconda3_5\envs\pvlibdev\lib\site-packages\numba\core\lowering.py", line 265, in lower_block
    self.lower_inst(inst)
  File "C:\Users\arahmatmand\Anaconda3_5\envs\pvlibdev\lib\site-packages\numba\core\lowering.py", line 567, in lower_inst
    func(self, inst)
  File "C:\Users\arahmatmand\Anaconda3_5\envs\pvlibdev\lib\site-packages\numba\parfors\parfor_lowering.py", line 348, in _lower_parfor_parallel
    call_parallel_gufunc(
  File "C:\Users\arahmatmand\Anaconda3_5\envs\pvlibdev\lib\site-packages\numba\parfors\parfor_lowering.py", line 1811, in call_parallel_gufunc
    builder.store(arg, ptr)
  File "C:\Users\arahmatmand\Anaconda3_5\envs\pvlibdev\lib\site-packages\llvmlite\ir\builder.py", line 778, in store
    raise TypeError("cannot store %s to %s: mismatching types"
TypeError: cannot store {float, i1} to {float, i8}*: mismatching types

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\arahmatmand\PythonForOF\GetDEM\getDEM.py", line 1, in <module>
    import py3dep
  File "C:\Users\arahmatmand\Anaconda3_5\envs\pvlibdev\lib\site-packages\py3dep\__init__.py", line 15, in <module>
    from py3dep.py3dep import (
  File "C:\Users\arahmatmand\Anaconda3_5\envs\pvlibdev\lib\site-packages\py3dep\py3dep.py", line 23, in <module>
    from py3dep import utils
  File "C:\Users\arahmatmand\Anaconda3_5\envs\pvlibdev\lib\site-packages\py3dep\utils.py", line 62, in <module>
    def _get_queued(
  File "C:\Users\arahmatmand\Anaconda3_5\envs\pvlibdev\lib\site-packages\numba\core\decorators.py", line 219, in wrapper
    disp.compile(sig)
  File "C:\Users\arahmatmand\Anaconda3_5\envs\pvlibdev\lib\site-packages\numba\core\dispatcher.py", line 965, in compile
    cres = self._compiler.compile(args, return_type)
  File "C:\Users\arahmatmand\Anaconda3_5\envs\pvlibdev\lib\site-packages\numba\core\dispatcher.py", line 125, in compile
    status, retval = self._compile_cached(args, return_type)
  File "C:\Users\arahmatmand\Anaconda3_5\envs\pvlibdev\lib\site-packages\numba\core\dispatcher.py", line 139, in _compile_cached
    retval = self._compile_core(args, return_type)
  File "C:\Users\arahmatmand\Anaconda3_5\envs\pvlibdev\lib\site-packages\numba\core\dispatcher.py", line 152, in _compile_core
    cres = compiler.compile_extra(self.targetdescr.typing_context,
  File "C:\Users\arahmatmand\Anaconda3_5\envs\pvlibdev\lib\site-packages\numba\core\compiler.py", line 716, in compile_extra
    return pipeline.compile_extra(func)
  File "C:\Users\arahmatmand\Anaconda3_5\envs\pvlibdev\lib\site-packages\numba\core\compiler.py", line 452, in compile_extra
    return self._compile_bytecode()
  File "C:\Users\arahmatmand\Anaconda3_5\envs\pvlibdev\lib\site-packages\numba\core\compiler.py", line 520, in _compile_bytecode
    return self._compile_core()
  File "C:\Users\arahmatmand\Anaconda3_5\envs\pvlibdev\lib\site-packages\numba\core\compiler.py", line 499, in _compile_core
    raise e
  File "C:\Users\arahmatmand\Anaconda3_5\envs\pvlibdev\lib\site-packages\numba\core\compiler.py", line 486, in _compile_core
    pm.run(self.state)
  File "C:\Users\arahmatmand\Anaconda3_5\envs\pvlibdev\lib\site-packages\numba\core\compiler_machinery.py", line 368, in run
    raise patched_exception
  File "C:\Users\arahmatmand\Anaconda3_5\envs\pvlibdev\lib\site-packages\numba\core\compiler_machinery.py", line 356, in run
    self._runPass(idx, pass_inst, state)
  File "C:\Users\arahmatmand\Anaconda3_5\envs\pvlibdev\lib\site-packages\numba\core\compiler_lock.py", line 35, in _acquire_compile_lock
    return func(*args, **kwargs)
  File "C:\Users\arahmatmand\Anaconda3_5\envs\pvlibdev\lib\site-packages\numba\core\compiler_machinery.py", line 311, in _runPass
    mutated |= check(pss.run_pass, internal_state)
  File "C:\Users\arahmatmand\Anaconda3_5\envs\pvlibdev\lib\site-packages\numba\core\compiler_machinery.py", line 273, in check
    mangled = func(compiler_state)
  File "C:\Users\arahmatmand\Anaconda3_5\envs\pvlibdev\lib\site-packages\numba\core\typed_passes.py", line 394, in run_pass
    lower.lower()
  File "C:\Users\arahmatmand\Anaconda3_5\envs\pvlibdev\lib\site-packages\numba\core\lowering.py", line 168, in lower
    self.lower_normal_function(self.fndesc)
  File "C:\Users\arahmatmand\Anaconda3_5\envs\pvlibdev\lib\site-packages\numba\core\lowering.py", line 222, in lower_normal_function
    entry_block_tail = self.lower_function_body()
  File "C:\Users\arahmatmand\Anaconda3_5\envs\pvlibdev\lib\site-packages\numba\core\lowering.py", line 251, in lower_function_body
    self.lower_block(block)
  File "C:\Users\arahmatmand\Anaconda3_5\envs\pvlibdev\lib\site-packages\numba\core\lowering.py", line 263, in lower_block
    with new_error_context('lowering "{inst}" at {loc}', inst=inst,
  File "C:\Users\arahmatmand\Anaconda3_5\envs\pvlibdev\lib\contextlib.py", line 153, in __exit__
    self.gen.throw(typ, value, traceback)
  File "C:\Users\arahmatmand\Anaconda3_5\envs\pvlibdev\lib\site-packages\numba\core\errors.py", line 837, in new_error_context
    raise newerr.with_traceback(tb)
numba.core.errors.LoweringError: Failed in nopython mode pipeline (step: native lowering)
cannot store {float, i1} to {float, i8}*: mismatching types

File "..\..\Anaconda3_5\envs\pvlibdev\lib\site-packages\py3dep\utils.py", line 88:
def _get_queued(
    <source elided>
    if elv_max is not None:
        queued = np.logical_and(queued, elevtn <= elv_max)
        ^

During: lowering "id=0[LoopNest(index_variable = parfor_index.47, range = (0, elevtn_size0.3, 1)), LoopNest(index_variable = parfor_index.48, range = (0, elevtn_size1.4, 1))]{282: <ir.Block at C:\Users\arahmatmand\Anaconda3_5\envs\pvlibdev\lib\site-packages\py3dep\utils.py (88)>}Var($parfor_index_tuple_var.54, utils.py:88)" at C:\Users\arahmatmand\Anaconda3_5\envs\pvlibdev\lib\site-packages\py3dep\utils.py (88)

Anything else we need to know?

No response

Environment

raceback (most recent call last): File "C:\Users\arahmatmand\Anaconda3_5\envs\pvlibdev\lib\site-packages\numba\core\errors.py", line 823, in new_error_context yield File "C:\Users\arahmatmand\Anaconda3_5\envs\pvlibdev\lib\site-packages\numba\core\lowering.py", line 265, in lower_block self.lower_inst(inst) File "C:\Users\arahmatmand\Anaconda3_5\envs\pvlibdev\lib\site-packages\numba\core\lowering.py", line 567, in lower_inst func(self, inst) File "C:\Users\arahmatmand\Anaconda3_5\envs\pvlibdev\lib\site-packages\numba\parfors\parfor_lowering.py", line 348, in _lower_parfor_parallel call_parallel_gufunc( File "C:\Users\arahmatmand\Anaconda3_5\envs\pvlibdev\lib\site-packages\numba\parfors\parfor_lowering.py", line 1811, in call_parallel_gufunc builder.store(arg, ptr) File "C:\Users\arahmatmand\Anaconda3_5\envs\pvlibdev\lib\site-packages\llvmlite\ir\builder.py", line 778, in store raise TypeError("cannot store %s to %s: mismatching types" TypeError: cannot store {float, i1} to {float, i8}*: mismatching types

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\arahmatmand\PythonForOF\GetDEM\getDEM.py", line 1, in
import py3dep
File "C:\Users\arahmatmand\Anaconda3_5\envs\pvlibdev\lib\site-packages\py3dep_init_.py", line 15, in
from py3dep.py3dep import (
File "C:\Users\arahmatmand\Anaconda3_5\envs\pvlibdev\lib\site-packages\py3dep\py3dep.py", line 23, in
from py3dep import utils
File "C:\Users\arahmatmand\Anaconda3_5\envs\pvlibdev\lib\site-packages\py3dep\utils.py", line 62, in
def _get_queued(
File "C:\Users\arahmatmand\Anaconda3_5\envs\pvlibdev\lib\site-packages\numba\core\decorators.py", line 219, in wrapper
disp.compile(sig)
File "C:\Users\arahmatmand\Anaconda3_5\envs\pvlibdev\lib\site-packages\numba\core\dispatcher.py", line 965, in compile
cres = self._compiler.compile(args, return_type)
File "C:\Users\arahmatmand\Anaconda3_5\envs\pvlibdev\lib\site-packages\numba\core\dispatcher.py", line 125, in compile
status, retval = self._compile_cached(args, return_type)
File "C:\Users\arahmatmand\Anaconda3_5\envs\pvlibdev\lib\site-packages\numba\core\dispatcher.py", line 139, in _compile_cached
retval = self._compile_core(args, return_type)
File "C:\Users\arahmatmand\Anaconda3_5\envs\pvlibdev\lib\site-packages\numba\core\dispatcher.py", line 152, in _compile_core
cres = compiler.compile_extra(self.targetdescr.typing_context,
File "C:\Users\arahmatmand\Anaconda3_5\envs\pvlibdev\lib\site-packages\numba\core\compiler.py", line 716, in compile_extra
return pipeline.compile_extra(func)
File "C:\Users\arahmatmand\Anaconda3_5\envs\pvlibdev\lib\site-packages\numba\core\compiler.py", line 452, in compile_extra
return self._compile_bytecode()
File "C:\Users\arahmatmand\Anaconda3_5\envs\pvlibdev\lib\site-packages\numba\core\compiler.py", line 520, in _compile_bytecode
return self._compile_core()
File "C:\Users\arahmatmand\Anaconda3_5\envs\pvlibdev\lib\site-packages\numba\core\compiler.py", line 499, in _compile_core
raise e
File "C:\Users\arahmatmand\Anaconda3_5\envs\pvlibdev\lib\site-packages\numba\core\compiler.py", line 486, in _compile_core
pm.run(self.state)
File "C:\Users\arahmatmand\Anaconda3_5\envs\pvlibdev\lib\site-packages\numba\core\compiler_machinery.py", line 368, in run
raise patched_exception
File "C:\Users\arahmatmand\Anaconda3_5\envs\pvlibdev\lib\site-packages\numba\core\compiler_machinery.py", line 356, in run
self._runPass(idx, pass_inst, state)
File "C:\Users\arahmatmand\Anaconda3_5\envs\pvlibdev\lib\site-packages\numba\core\compiler_lock.py", line 35, in _acquire_compile_lock
return func(args, **kwargs)
File "C:\Users\arahmatmand\Anaconda3_5\envs\pvlibdev\lib\site-packages\numba\core\compiler_machinery.py", line 311, in _runPass
mutated |= check(pss.run_pass, internal_state)
File "C:\Users\arahmatmand\Anaconda3_5\envs\pvlibdev\lib\site-packages\numba\core\compiler_machinery.py", line 273, in check
mangled = func(compiler_state)
File "C:\Users\arahmatmand\Anaconda3_5\envs\pvlibdev\lib\site-packages\numba\core\typed_passes.py", line 394, in run_pass
lower.lower()
File "C:\Users\arahmatmand\Anaconda3_5\envs\pvlibdev\lib\site-packages\numba\core\lowering.py", line 168, in lower
self.lower_normal_function(self.fndesc)
File "C:\Users\arahmatmand\Anaconda3_5\envs\pvlibdev\lib\site-packages\numba\core\lowering.py", line 222, in lower_normal_function
entry_block_tail = self.lower_function_body()
File "C:\Users\arahmatmand\Anaconda3_5\envs\pvlibdev\lib\site-packages\numba\core\lowering.py", line 251, in lower_function_body
self.lower_block(block)
File "C:\Users\arahmatmand\Anaconda3_5\envs\pvlibdev\lib\site-packages\numba\core\lowering.py", line 263, in lower_block
with new_error_context('lowering "{inst}" at {loc}', inst=inst,
File "C:\Users\arahmatmand\Anaconda3_5\envs\pvlibdev\lib\contextlib.py", line 153, in exit
self.gen.throw(typ, value, traceback)
File "C:\Users\arahmatmand\Anaconda3_5\envs\pvlibdev\lib\site-packages\numba\core\errors.py", line 837, in new_error_context
raise newerr.with_traceback(tb)
numba.core.errors.LoweringError: Failed in nopython mode pipeline (step: native lowering)
cannot store {float, i1} to {float, i8}
: mismatching types

File "....\Anaconda3_5\envs\pvlibdev\lib\site-packages\py3dep\utils.py", line 88:
def _get_queued(

if elv_max is not None:
queued = np.logical_and(queued, elevtn <= elv_max)
^

During: lowering "id=0[LoopNest(index_variable = parfor_index.47, range = (0, elevtn_size0.3, 1)), LoopNest(index_variable = parfor_index.48, range = (0, elevtn_size1.4, 1))]{282: <ir.Block at C:\Users\arahmatmand\Anaconda3_5\envs\pvlibdev\lib\site-packages\py3dep\utils.py (88)>}Var($parfor_index_tuple_var.54, utils.py:88)" at C:\Users\arahmatmand\Anaconda3_5\envs\pvlibdev\lib\site-packages\py3dep\utils.py (88)

Can you please let me know your Python, numba, and numpy version, and also which version of py3dep did you install? I cannot reproduce this error on my machine with Python 3.12 and the latest version of py3dep.

Hi, thanks for the quick response, below are the versions.
Python 3.10.9
numpy 1.23.5
numba 0.56.4 pypi_0 pypi
py3dep 0.16.3 pypi_0 pypi

Thanks

I can confirm that I was able to reproduce this error with the config that you provided. This seems to be related to a bug in numba=0.56.4, since when I updated it to numba=0.57, it worked. Please update the numba in your env to the latest version. In the next release, I will increase the min numba version to 0.57 to prevent installing the version with this bug.