scipy.ndimage是
我正在尝试使用librosa库,但无论我做什么,我都会接受以下按摩(在Anaconda上使用Python 3.8和PyCharm(
我正在尝试:
import librosa
import IPython.display as ipd
sr = 22050 # sample rate
T = 5.0 # seconds
t = np.linspace(0, T, int(T*sr), endpoint=False) # time variable
x = 0.5*np.sin(2*np.pi*220*t)# pure sine wave at 220 Hz
#Playing the audio
ipd.Audio(x, rate=sr) # load a NumPy array
#Saving the audio
librosa.output.write_wav('tone_220.wav', x, sr)`
我得到的:
Traceback (most recent call last):
File "D:/Fall_2020/END/Yeni klasör/test.py", line 2, in <module>
import librosa
File "C:UsersUGURAanaconda3libsite-packageslibrosa__init__.py", line 211, in <module>
from . import core
File "C:UsersUGURAanaconda3libsite-packageslibrosacore__init__.py", line 5, in <module>
from .convert import * # pylint: disable=wildcard-import
File "C:UsersUGURAanaconda3libsite-packageslibrosacoreconvert.py", line 7, in <module>
from . import notation
File "C:UsersUGURAanaconda3libsite-packageslibrosacorenotation.py", line 8, in <module>
from ..util.exceptions import ParameterError
File "C:UsersUGURAanaconda3libsite-packageslibrosautil__init__.py", line 83, in <module>
from .utils import * # pylint: disable=wildcard-import
File "C:UsersUGURAanaconda3libsite-packageslibrosautilutils.py", line 6, in <module>
import scipy.ndimage
ModuleNotFoundError: No module named 'scipy.ndimage'
Process finished with exit code 1
有人能帮我解决这个问题吗?我应该卸载librosa吗?我试着用conda和pip安装,没有结果。
scipy
包的一部分。尝试pip install scipy
。
通常情况下,当您安装librosa时,它会自动插入。为什么在这种情况下没有,如果没有看到pip安装日志,我们就无法知道。