1

I imported librosa package via python shell as following:

python -m pip install librosa

The import was successful.When I ran init.py of my librosa core, it threw this type of error.

> Traceback (most recent call last):
  File "C:\Users\VC\AppData\Local\Programs\Python\Python38-32\Lib\site-packages\librosa\core\__init__.py", line 125, in <module>
    from .time_frequency import *  # pylint: disable=wildcard-import
ImportError: attempted relative import with no known parent package

The librosa has the following code:

from .time_frequency import *  # pylint: disable=wildcard-import
from .audio import *  # pylint: disable=wildcard-import
from .spectrum import *  # pylint: disable=wildcard-import
from .pitch import *  # pylint: disable=wildcard-import
from .constantq import *  # pylint: disable=wildcard-import
from .harmonic import *  # pylint: disable=wildcard-import
from .fft import *  # pylint: disable=wildcard-import

__all__ = [_ for _ in dir() if not _.startswith('_')]

Due to this error i am not able to import librosa in my code. Please help.

napuzba
  • 6,033
  • 3
  • 21
  • 32
Supraja
  • 11
  • 7

0 Answers0