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.

Librosa import hangs indefinitely

See original GitHub issue

I tried importing librosa, and after four hours, nothing happens. So I just threw an interrupt:

C:\Users\Admin\Downloads\RealTimeVoiceCloning>python librosa_test.py
Traceback (most recent call last):
  File "C:\Program Files\Python37\lib\tempfile.py", line 258, in _mkstemp_inner
    fd = _os.open(file, flags, 0o600)
PermissionError: [Errno 13] Permission denied: 'C:\\Program Files\\Python37\\lib\\site-packages\\librosa\\util\\__pycache__\\tmpss5yoa_m'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "librosa_test.py", line 1, in <module>
    import librosa
  File "C:\Program Files\Python37\lib\site-packages\librosa\__init__.py", line 211, in <module>
    from . import core
  File "C:\Program Files\Python37\lib\site-packages\librosa\core\__init__.py", line 5, in <module>
    from .convert import *  # pylint: disable=wildcard-import
  File "C:\Program Files\Python37\lib\site-packages\librosa\core\convert.py", line 7, in <module>
    from . import notation
  File "C:\Program Files\Python37\lib\site-packages\librosa\core\notation.py", line 8, in <module>
    from ..util.exceptions import ParameterError
  File "C:\Program Files\Python37\lib\site-packages\librosa\util\__init__.py", line 83, in <module>
    from .utils import *  # pylint: disable=wildcard-import
  File "C:\Program Files\Python37\lib\site-packages\librosa\util\utils.py", line 1848, in <module>
    def __shear_dense(X, factor=+1, axis=-1):
  File "C:\Program Files\Python37\lib\site-packages\numba\decorators.py", line 193, in wrapper
    disp.enable_caching()
  File "C:\Program Files\Python37\lib\site-packages\numba\dispatcher.py", line 679, in enable_caching
    self._cache = FunctionCache(self.py_func)
  File "C:\Program Files\Python37\lib\site-packages\numba\caching.py", line 614, in __init__
    self._impl = self._impl_class(py_func)
  File "C:\Program Files\Python37\lib\site-packages\numba\caching.py", line 344, in __init__
    locator = cls.from_function(py_func, source_path)
  File "C:\Program Files\Python37\lib\site-packages\numba\caching.py", line 183, in from_function
    self.ensure_cache_path()
  File "C:\Program Files\Python37\lib\site-packages\numba\caching.py", line 127, in ensure_cache_path
    tempfile.TemporaryFile(dir=path).close()
  File "C:\Program Files\Python37\lib\tempfile.py", line 547, in NamedTemporaryFile
    (fd, name) = _mkstemp_inner(dir, prefix, suffix, flags, output_type)
  File "C:\Program Files\Python37\lib\tempfile.py", line 258, in _mkstemp_inner
    fd = _os.open(file, flags, 0o600)
KeyboardInterrupt

Code:

import librosa

I use librosa version 0.8.0.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
HENDRIX-ZT2commented, Jul 19, 2021

Oh, I’ve found this issue and it is definitely due to lack of admin rights.

https://github.com/librosa/librosa/issues/987

0reactions
HENDRIX-ZT2commented, Jul 19, 2021

Still getting this infinite importing error with librosa 0.8.1. Very weird.

However, it does work when I run it from the console.

import librosa x = librosa.load(“C:/Users/arnfi/Desktop/She Loves You twin track.flac”) x (array([-1.2100296e-05, -2.5023572e-05, -1.7120303e-05, …, 6.5918744e-04, 7.5510115e-04, 0.0000000e+00], dtype=float32), 22050)

So I can import librosa from an interpreter, but can not import it from even the simplest py file:

print("hello")
import librosa
print("done")

Running this py file just prints “hello”, and nothing else happens.

Following setup:

Python 3.7.8 (tags/v3.7.8:4b47a5b6ba, Jun 28 2020, 08:53:46) [MSC v.1916 64 bit (AMD64)] on win32

Installed packages: appdirs==1.4.4 audioread==2.1.8 beautifulsoup4==4.9.3 certifi==2020.6.20 cffi==1.14.0 chardet==3.0.4 colorspacious==1.1.2 cycler==0.10.0 decorator==4.4.2 demucs==2.0.0 diffq==0.1.0 freetype-py==2.1.0.post1 idna==2.10 imageio==2.6.1 Jinja2==2.11.2 joblib==0.14.1 julius==0.2.3 kiwisolver==1.1.0 lameenc==1.3.1 librosa==0.8.1 llvmlite==0.31.0 MarkupSafe==1.1.1 matplotlib==3.2.1 numba==0.48.0 numpy==1.19.3 opencv-python==4.2.0.34 packaging==20.4 pandas==1.2.5 Pillow==6.2.1 pooch==1.1.1 pyaudiorestoration==1.0 pycparser==2.20 pyexiv2==2.3.1 PyFFI==2.2.4.dev3 pyfftw==0.12.0 pyparsing==2.4.6 PyQt5==5.14.0 PyQt5-sip==12.7.0 pysoundfile==0.9.0.post1 python-dateutil==2.8.1 pytz==2021.1 requests==2.24.0 resampy==0.2.2 scikit-learn==0.22.2.post1 scipy==1.4.1 six==1.14.0 soundfile==0.10.3.post1 soundstretch==1.2 soupsieve==2.1 torch==1.8.1+cu111 torchaudio==0.8.1 torchvision==0.9.1+cu111 tqdm==4.45.0 typing-extensions==3.10.0.0 urllib3==1.25.10 viscm==0.9 vispy==0.6.4

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshooting — librosa 0.10.0.dev0 documentation
it is because the librosa.display submodule needs to be imported explicitly in librosa versions earlier than 0.10. This is because matplotlib is an...
Read more >
Librosa: Python Library for Audio and Music analysis - Morioh
librosa. A python package for music and audio analysis. Documentation. See https://librosa.org/doc/ for a complete reference manual and introductory ...
Read more >
1 Answer - 1 - Stack Overflow
The problem is a wsgi error and appears to be due to import of librosa and numba. I have been stuck on these...
Read more >
Deep Learning with Audio Thread - Fast.ai forums
@MadeUpMasters Found a method to do it in the librosa.effects module: ... call last): File "crash.py", line 1, in <module> import torchaudio ...
Read more >
spleeter/community - Gitter
So we're adding the possibility to use librosa instead for these transforms. ... from tensorflow.python.pywrap_tensorflow_internal import
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