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.

Bug when import librosa

See original GitHub issue

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

github_iconTop GitHub Comments

2reactions
bmcfeecommented, Apr 11, 2022

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.

1reaction
carlthomecommented, Mar 29, 2022

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:

!uname -r
!lsb_release -a
!lscpu
5.10.90+
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 20.04.3 LTS
Release:	20.04
Codename:	focal
Architecture:                    x86_64
CPU op-mode(s):                  32-bit, 64-bit
Byte Order:                      Little Endian
Address sizes:                   46 bits physical, 48 bits virtual
CPU(s):                          2
On-line CPU(s) list:             0,1
Thread(s) per core:              2
Core(s) per socket:              1
Socket(s):                       1
NUMA node(s):                    1
Vendor ID:                       GenuineIntel
CPU family:                      6
Model:                           79
Model name:                      Intel(R) Xeon(R) CPU @ 2.20GHz
Stepping:                        0
CPU MHz:                         2199.998
BogoMIPS:                        4399.99
Hypervisor vendor:               KVM
Virtualization type:             full
L1d cache:                       32 KiB
L1i cache:                       32 KiB
L2 cache:                        256 KiB
L3 cache:                        55 MiB
NUMA node0 CPU(s):               0,1
Vulnerability Itlb multihit:     Not affected
Vulnerability L1tf:              Mitigation; PTE Inversion
Vulnerability Mds:               Mitigation; Clear CPU buffers; SMT Host state u
                                 nknown
Vulnerability Meltdown:          Mitigation; PTI
Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled v
                                 ia prctl and seccomp
Vulnerability Spectre v1:        Mitigation; usercopy/swapgs barriers and __user
                                  pointer sanitization
Vulnerability Spectre v2:        Mitigation; Full generic retpoline, IBPB condit
                                 ional, IBRS_FW, STIBP conditional, RSB filling
Vulnerability Srbds:             Not affected
Vulnerability Tsx async abort:   Mitigation; Clear CPU buffers; SMT Host state u
                                 nknown
Flags:                           fpu vme de pse tsc msr pae mce cx8 apic sep mtr
                                 r pge mca cmov pat pse36 clflush mmx fxsr sse s
                                 se2 ss ht syscall nx pdpe1gb rdtscp lm constant
                                 _tsc rep_good nopl xtopology nonstop_tsc cpuid 
                                 tsc_known_freq pni pclmulqdq ssse3 fma cx16 pci
                                 d sse4_1 sse4_2 x2apic movbe popcnt aes xsave a
                                 vx f16c rdrand hypervisor lahf_lm abm 3dnowpref
                                 etch invpcid_single pti ssbd ibrs ibpb stibp fs
                                 gsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms 
                                 invpcid rtm rdseed adx smap xsaveopt arat md_cl
                                 ear arch_capabilities
Read more comments on GitHub >

github_iconTop 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 >

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