Bug when import librosa
See original GitHub issueDescribe the bug When I import the module, it raise bug like this.
To Reproduce
import librosa
Expected behavior
---------------------------------------------------------------------------
RuntimeError Traceback (most recent call last)
/tmp/ipykernel_34/1121779986.py in <module>
----> 1 import librosa
/opt/conda/lib/python3.7/site-packages/librosa/__init__.py in <module>
207 # And all the librosa sub-modules
208 from ._cache import cache
--> 209 from . import core
210 from . import beat
211 from . import decompose
/opt/conda/lib/python3.7/site-packages/librosa/core/__init__.py in <module>
4
5 from .convert import * # pylint: disable=wildcard-import
----> 6 from .audio import * # pylint: disable=wildcard-import
7 from .spectrum import * # pylint: disable=wildcard-import
8 from .pitch import * # pylint: disable=wildcard-import
/opt/conda/lib/python3.7/site-packages/librosa/core/audio.py in <module>
10 import numpy as np
11 import scipy.signal
---> 12 import resampy
13
14 from numba import jit
/opt/conda/lib/python3.7/site-packages/resampy/__init__.py in <module>
5 from .version import version as __version__
6 from . import filters
----> 7 from .core import *
/opt/conda/lib/python3.7/site-packages/resampy/core.py in <module>
7 from .filters import get_filter
8
----> 9 from .interpn import resample_f
10
11 __all__ = ['resample']
/opt/conda/lib/python3.7/site-packages/resampy/interpn.py in <module>
5
6
----> 7 @numba.jit(nopython=True, nogil=True)
8 def resample_f(x, y, sample_ratio, interp_win, interp_delta, num_table):
9
/opt/conda/lib/python3.7/site-packages/numba/core/decorators.py in wrapper(func)
215 disp = dispatcher(py_func=func, locals=locals,
216 targetoptions=targetoptions,
--> 217 **dispatcher_args)
218 if cache:
219 disp.enable_caching()
/opt/conda/lib/python3.7/site-packages/numba/core/dispatcher.py in __init__(self, py_func, locals, targetoptions, impl_kind, pipeline_class)
836 """
837 self.typingctx = self.targetdescr.typing_context
--> 838 self.targetctx = self.targetdescr.target_context
839
840 pysig = utils.pysignature(py_func)
/opt/conda/lib/python3.7/site-packages/numba/core/registry.py in target_context(self)
45 return nested
46 else:
---> 47 return self._toplevel_target_context
48
49 @property
/opt/conda/lib/python3.7/site-packages/numba/core/utils.py in __get__(self, instance, owner)
360 val = cache.get(self.attrname, _NOT_FOUND)
361 if val is _NOT_FOUND:
--> 362 val = self.func(instance)
363 try:
364 cache[self.attrname] = val
/opt/conda/lib/python3.7/site-packages/numba/core/registry.py in _toplevel_target_context(self)
29 def _toplevel_target_context(self):
30 # Lazily-initialized top-level target context, for all threads
---> 31 return cpu.CPUContext(self.typing_context, self._target_name)
32
33 @utils.cached_property
/opt/conda/lib/python3.7/site-packages/numba/core/cpu.py in __init__(self, typingctx, target)
39
40 def __init__(self, typingctx, target='cpu'):
---> 41 super().__init__(typingctx, target)
42
43 # Overrides
/opt/conda/lib/python3.7/site-packages/numba/core/base.py in __init__(self, typing_context, target)
259
260 # Initialize
--> 261 self.init()
262
263 def init(self):
/opt/conda/lib/python3.7/site-packages/numba/core/compiler_lock.py in _acquire_compile_lock(*args, **kwargs)
33 def _acquire_compile_lock(*args, **kwargs):
34 with self:
---> 35 return func(*args, **kwargs)
36 return _acquire_compile_lock
37
/opt/conda/lib/python3.7/site-packages/numba/core/cpu.py in init(self)
48 def init(self):
49 self.is32bit = (utils.MACHINE_BITS == 32)
---> 50 self._internal_codegen = codegen.JITCPUCodegen("numba.exec")
51
52 # Add ARM ABI functions from libgcc_s
/opt/conda/lib/python3.7/site-packages/numba/core/codegen.py in __init__(self, module_name)
1169 self._llvm_module.name = "global_codegen_module"
1170 self._rtlinker = RuntimeLinker()
-> 1171 self._init(self._llvm_module)
1172
1173 def _init(self, llvm_module):
/opt/conda/lib/python3.7/site-packages/numba/core/codegen.py in _init(self, llvm_module)
1174 assert list(llvm_module.global_variables) == [], "Module isn't empty"
1175
-> 1176 target = ll.Target.from_triple(ll.get_process_triple())
1177 tm_options = dict(opt=config.OPT)
1178 self._tm_features = self._customize_tm_features()
/opt/conda/lib/python3.7/site-packages/llvmlite/binding/targets.py in from_triple(cls, triple)
195 outerr)
196 if not target:
--> 197 raise RuntimeError(str(outerr))
198 target = cls(target)
199 target._triple = triple
RuntimeError: Unable to find target for this triple (no targets are registered)
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
import librosa error ? · Issue #1013 - GitHub
The quick fix is to install librosa in a miniconda environment rather than by using pip.
Read more >Troubleshooting — librosa 0.10.0.dev0 documentation
For bug reports and other, more technical issues, consult the github issues. Here are a few of the most common problems that users...
Read more >Error while importing Librosa on python - Stack Overflow
I am struggling to import Librosa library for sound analyses. When I enter import librosa. I get the following error
Read more >Error importing librosa - Google Groups
Hi! I was using librosa without any problem until yesterday when i tried to import it and the following message appeared.
Read more >librosa - PyPI
librosa. A python package for music and audio analysis. PyPI Anaconda-Server Badge License DOI ... import librosa librosa.show_versions().
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’m closing this out due to lack of communication and detail from the original poster. I suspect that there’s nothing wrong on our side though, and whatever problem exists is upstream (eg via numba or llvmlite).
@tuanio if you want to provide more detail, we can reopen and discuss.
Perhaps @tuanio meant the environment is a Kaggle kernel in case it’s something like Python 3.7 on Ubuntu 20.04 on Intel CPUs.
Info: https://github.com/kaggle/docker-python
And from a scratchpad at https://www.kaggle.com/code/ just now: