所以我只是想安装umap-learn模块。 当我尝试导入它时,我收到以下错误报告。我似乎无法使用任何解决此问题的方法。 我不知道如何开始追查错误。
欢迎提供有关如何解决此问题的任何建议。
我尝试使用pip检查依赖项,无论如何都要重新安装它们,并检查我的python和jupyter lab版本。我发现一些numba线程应该已经解决了这个问题,如果问题不在模块中
How to Solve Numba Lowering error?
在安装R模块时,我不得不做一些不确定的事情,例如手动更改PATH,R_USER和R_HOME变量。
>>>import umap
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
c:\users\utilisateur\appdata\local\programs\python\python37-32\lib\site-packages\numba\errors.py in new_error_context(fmt_, *args, **kwargs)
616 try:
--> 617 yield
618 except NumbaError as e:
c:\users\utilisateur\appdata\local\programs\python\python37-32\lib\site-packages\numba\lowering.py in lower_block(self, block)
258 loc=self.loc, errcls_=defaulterrcls):
--> 259 self.lower_inst(inst)
260
c:\users\utilisateur\appdata\local\programs\python\python37-32\lib\site-packages\numba\lowering.py in lower_inst(self, inst)
307 ty = self.typeof(inst.target.name)
--> 308 val = self.lower_assign(ty, inst)
309 self.storevar(val, inst.target.name)
c:\users\utilisateur\appdata\local\programs\python\python37-32\lib\site-packages\numba\lowering.py in lower_assign(self, ty, inst)
453 elif isinstance(value, ir.Expr):
--> 454 return self.lower_expr(ty, value)
455
c:\users\utilisateur\appdata\local\programs\python\python37-32\lib\site-packages\numba\lowering.py in lower_expr(self, resty, expr)
882 elif expr.op == 'call':
--> 883 res = self.lower_call(resty, expr)
884 return res
c:\users\utilisateur\appdata\local\programs\python\python37-32\lib\site-packages\numba\lowering.py in lower_call(self, resty, expr)
848
--> 849 res = impl(self.builder, argvals, self.loc)
850
c:\users\utilisateur\appdata\local\programs\python\python37-32\lib\site-packages\numba\targets\base.py in __call__(self, builder, args, loc)
1123 def __call__(self, builder, args, loc=None):
-> 1124 return self._imp(self._context, builder, self._sig, args, loc=loc)
1125
c:\users\utilisateur\appdata\local\programs\python\python37-32\lib\site-packages\numba\targets\base.py in wrapper(*args, **kwargs)
1146 kwargs.pop('loc') # drop unused loc
-> 1147 return fn(*args, **kwargs)
1148
c:\users\utilisateur\appdata\local\programs\python\python37-32\lib\site-packages\numba\targets\arrayobj.py in numpy_zeros_nd(context, builder, sig, args)
3279 arrtype, shapes = _parse_empty_args(context, builder, sig, args)
-> 3280 ary = _empty_nd_impl(context, builder, arrtype, shapes)
3281 _zero_fill_array(context, builder, ary)
c:\users\utilisateur\appdata\local\programs\python\python37-32\lib\site-packages\numba\targets\arrayobj.py in _empty_nd_impl(context, builder, arrtype, shapes)
3166 for s in shapes:
-> 3167 arrlen = builder.mul(arrlen, s)
3168
c:\users\utilisateur\appdata\local\programs\python\python37-32\lib\site-packages\llvmlite\ir\builder.py in wrapped(self, lhs, rhs, name, flags)
23 raise ValueError("Operands must be the same type, got (%s, %s)"
---> 24 % (lhs.type, rhs.type))
25 instr = cls(self.block, lhs.type, opname, (lhs, rhs), name, flags)
ValueError: Operands must be the same type, got (i32, i64)
During handling of the above exception, another exception occurred:
LoweringError Traceback (most recent call last)
<ipython-input-7-14a2a0400894> in <module>
1
----> 2 import umap
3 print(umap)
c:\users\utilisateur\appdata\local\programs\python\python37-32\lib\site-packages\umap\__init__.py in <module>
----> 1 from .umap_ import UMAP
2
3 # Workaround: https://github.com/numba/numba/issues/3341
4 import numba
5 numba.config.THREADING_LAYER = 'workqueue'
c:\users\utilisateur\appdata\local\programs\python\python37-32\lib\site-packages\umap\umap_.py in <module>
26 import umap.distances as dist
27
---> 28 import umap.sparse as sparse
29
30 from umap.utils import tau_rand_int, deheap_sort, submatrix, ts
c:\users\utilisateur\appdata\local\programs\python\python37-32\lib\site-packages\umap\sparse.py in <module>
7 import numba
8
----> 9 from umap.utils import (
10 tau_rand_int,
11 tau_rand,
c:\users\utilisateur\appdata\local\programs\python\python37-32\lib\site-packages\umap\utils.py in <module>
106
107
--> 108 @numba.njit("f8[:, :, :](i8,i8)")
109 def make_heap(n_points, size):
110 """Constructor for the numba enabled heap objects. The heaps are used
c:\users\utilisateur\appdata\local\programs\python\python37-32\lib\site-packages\numba\decorators.py in wrapper(func)
181 with typeinfer.register_dispatcher(disp):
182 for sig in sigs:
--> 183 disp.compile(sig)
184 disp.disable_compile()
185 return disp
c:\users\utilisateur\appdata\local\programs\python\python37-32\lib\site-packages\numba\compiler_lock.py in _acquire_compile_lock(*args, **kwargs)
30 def _acquire_compile_lock(*args, **kwargs):
31 with self:
---> 32 return func(*args, **kwargs)
33 return _acquire_compile_lock
34
c:\users\utilisateur\appdata\local\programs\python\python37-32\lib\site-packages\numba\dispatcher.py in compile(self, sig)
653
654 self._cache_misses[sig] += 1
--> 655 cres = self._compiler.compile(args, return_type)
656 self.add_overload(cres)
657 self._cache.save_overload(sig, cres)
c:\users\utilisateur\appdata\local\programs\python\python37-32\lib\site-packages\numba\dispatcher.py in compile(self, args, return_type)
80 args=args, return_type=return_type,
81 flags=flags, locals=self.locals,
---> 82 pipeline_class=self.pipeline_class)
83 # Check typing error if object mode is used
84 if cres.typing_error is not None and not flags.enable_pyobject:
c:\users\utilisateur\appdata\local\programs\python\python37-32\lib\site-packages\numba\compiler.py in compile_extra(typingctx, targetctx, func, args, return_type, flags, locals, library, pipeline_class)
924 pipeline = pipeline_class(typingctx, targetctx, library,
925 args, return_type, flags, locals)
--> 926 return pipeline.compile_extra(func)
927
928
c:\users\utilisateur\appdata\local\programs\python\python37-32\lib\site-packages\numba\compiler.py in compile_extra(self, func)
372 self.lifted = ()
373 self.lifted_from = None
--> 374 return self._compile_bytecode()
375
376 def compile_ir(self, func_ir, lifted=(), lifted_from=None):
c:\users\utilisateur\appdata\local\programs\python\python37-32\lib\site-packages\numba\compiler.py in _compile_bytecode(self)
855 """
856 assert self.func_ir is None
--> 857 return self._compile_core()
858
859 def _compile_ir(self):
c:\users\utilisateur\appdata\local\programs\python\python37-32\lib\site-packages\numba\compiler.py in _compile_core(self)
842 self.define_pipelines(pm)
843 pm.finalize()
--> 844 res = pm.run(self.status)
845 if res is not None:
846 # Early pipeline completion
c:\users\utilisateur\appdata\local\programs\python\python37-32\lib\site-packages\numba\compiler_lock.py in _acquire_compile_lock(*args, **kwargs)
30 def _acquire_compile_lock(*args, **kwargs):
31 with self:
---> 32 return func(*args, **kwargs)
33 return _acquire_compile_lock
34
c:\users\utilisateur\appdata\local\programs\python\python37-32\lib\site-packages\numba\compiler.py in run(self, status)
253 # No more fallback pipelines?
254 if is_final_pipeline:
--> 255 raise patched_exception
256 # Go to next fallback pipeline
257 else:
c:\users\utilisateur\appdata\local\programs\python\python37-32\lib\site-packages\numba\compiler.py in run(self, status)
244 try:
245 event(stage_name)
--> 246 stage()
247 except _EarlyPipelineCompletion as e:
248 return e.result
c:\users\utilisateur\appdata\local\programs\python\python37-32\lib\site-packages\numba\compiler.py in stage_nopython_backend(self)
715 """
716 lowerfn = self.backend_nopython_mode
--> 717 self._backend(lowerfn, objectmode=False)
718
719 def stage_compile_interp_mode(self):
c:\users\utilisateur\appdata\local\programs\python\python37-32\lib\site-packages\numba\compiler.py in _backend(self, lowerfn, objectmode)
664 self.library.enable_object_caching()
665
--> 666 lowered = lowerfn()
667 signature = typing.signature(self.return_type, *self.args)
668 self.cr = compile_result(
c:\users\utilisateur\appdata\local\programs\python\python37-32\lib\site-packages\numba\compiler.py in backend_nopython_mode(self)
651 self.calltypes,
652 self.flags,
--> 653 self.metadata)
654
655 def _backend(self, lowerfn, objectmode):
c:\users\utilisateur\appdata\local\programs\python\python37-32\lib\site-packages\numba\compiler.py in native_lowering_stage(targetctx, library, interp, typemap, restype, calltypes, flags, metadata)
1046 lower = lowering.Lower(targetctx, library, fndesc, interp,
1047 metadata=metadata)
-> 1048 lower.lower()
1049 if not flags.no_cpython_wrapper:
1050 lower.create_cpython_wrapper(flags.release_gil)
c:\users\utilisateur\appdata\local\programs\python\python37-32\lib\site-packages\numba\lowering.py in lower(self)
176 if self.generator_info is None:
177 self.genlower = None
--> 178 self.lower_normal_function(self.fndesc)
179 else:
180 self.genlower = self.GeneratorLower(self)
c:\users\utilisateur\appdata\local\programs\python\python37-32\lib\site-packages\numba\lowering.py in lower_normal_function(self, fndesc)
217 # Init argument values
218 self.extract_function_arguments()
--> 219 entry_block_tail = self.lower_function_body()
220
221 # Close tail of entry block
c:\users\utilisateur\appdata\local\programs\python\python37-32\lib\site-packages\numba\lowering.py in lower_function_body(self)
242 bb = self.blkmap[offset]
243 self.builder.position_at_end(bb)
--> 244 self.lower_block(block)
245
246 self.post_lower()
c:\users\utilisateur\appdata\local\programs\python\python37-32\lib\site-packages\numba\lowering.py in lower_block(self, block)
257 with new_error_context('lowering "{inst}" at {loc}', inst=inst,
258 loc=self.loc, errcls_=defaulterrcls):
--> 259 self.lower_inst(inst)
260
261 def create_cpython_wrapper(self, release_gil=False):
c:\users\utilisateur\appdata\local\programs\python\python37-32\lib\contextlib.py in __exit__(self, type, value, traceback)
128 value = type()
129 try:
--> 130 self.gen.throw(type, value, traceback)
131 except StopIteration as exc:
132 # Suppress StopIteration *unless* it's the same exception that
c:\users\utilisateur\appdata\local\programs\python\python37-32\lib\site-packages\numba\errors.py in new_error_context(fmt_, *args, **kwargs)
623 from numba import config
624 tb = sys.exc_info()[2] if config.FULL_TRACEBACKS else None
--> 625 six.reraise(type(newerr), newerr, tb)
626
627
c:\users\utilisateur\appdata\local\programs\python\python37-32\lib\site-packages\numba\six.py in reraise(tp, value, tb)
657 if value.__traceback__ is not tb:
658 raise value.with_traceback(tb)
--> 659 raise value
660
661 else:
LoweringError: Failed in nopython mode pipeline (step: nopython mode backend)
Operands must be the same type, got (i32, i64)
File "c:\users\utilisateur\appdata\local\programs\python\python37-32\lib\site-packages\umap\utils.py", line 131:
def make_heap(n_points, size):
<source elided>
"""
result = np.zeros((3, int(n_points), int(size)), dtype=np.float64)
^
[1] During: lowering "$0.14 = call $0.2($0.10, func=$0.2, args=[Var($0.10, c:\users\utilisateur\appdata\local\programs\python\python37-32\lib\site-packages\umap\utils.py (131))], kws=[('dtype', Var($0.12, c:\users\utilisateur\appdata\local\programs\python\python37-32\lib\site-packages\umap\utils.py (131)))], vararg=None)" at c:\users\utilisateur\appdata\local\programs\python\python37-32\lib\site-packages\umap\utils.py (131)