RuntimeError: 'path' must be None or a list, not <class '_frozen_importlib_external._NamespacePath'>

1,088 views
Skip to first unread message

terk...@gmail.com

unread,
Dec 21, 2017, 10:11:25 AM12/21/17
to librosa
# Hi there!

# I have a problem with installing LIBROSA library for analysis of audio files in python.

# I use "WinPython-64bit-3.6.2.0Qt5" in "Spyder". I installed "librosa-0.5.1" from github and wrote this code:

from __future__ import print_function
import argparse
import sys
import librosa
import librosa.util
import librosa.core

# When I execute "import librosa.util", I get this:

In [79]: import librosa.util

# This is allright I think. But when I execute "import librosa.core", I get this:

In [78]: import librosa.core
Traceback (most recent call last):

  File "<ipython-input-78-820f53fd5f2c>", line 1, in <module>
    import librosa.core

  File "<frozen importlib._bootstrap>", line 961, in _find_and_load

  File "<frozen importlib._bootstrap>", line 946, in _find_and_load_unlocked

  File "<frozen importlib._bootstrap>", line 881, in _find_spec

  File "<frozen importlib._bootstrap>", line 855, in _find_spec_legacy

  File "C:\Users\Voglova\Anaconda_set\WinPython-64bit-3.6.2.0Qt5\python-3.6.2.amd64\lib\site-packages\pyximport\pyximport.py", line 253, in find_module
    fp, pathname, (ext,mode,ty) = imp.find_module(fullname,package_path)

  File "C:\Users\Voglova\Anaconda_set\WinPython-64bit-3.6.2.0Qt5\python-3.6.2.amd64\lib\imp.py", line 270, in find_module
    "not {}".format(type(path)))

RuntimeError: 'path' must be None or a list, not <class '_frozen_importlib_external._NamespacePath'>


# I checked the name of the folders and if there is a __init__ file, and everything seems allright. I really didn't find any difference between "util" and "core" folder that can cause the error.

# Do you have any idea why it returns me this error?

# Thanks a lot for your help!

Brian McFee

unread,
Dec 29, 2017, 11:10:24 AM12/29/17
to librosa
That's pretty strange.  Would you mind filling out a bug report on github? https://github.com/librosa/librosa/issues/new

Incidentally, you shouldn't need to explicitly import util and core, as they're loaded by the package import.  The only submodule that requires explicit importing is display, and that's because its dependencies (matplotlib) are optional.
Reply all
Reply to author
Forward
0 new messages