我試圖使用pyAudioAnalysis庫從mp3文件中提取功能。我遇到的問題是我無法讓我的Jupyter Notebook找到eyed3,這對於圖書館來說很重要。這裏是我的代碼:Jupyter筆記本不識別Eyed3
from pyAudioAnalysis import audioBasicIO
from pyAudioAnalysis import audioFeatureExtraction
import matplotlib.pyplot as plt
[Fs, x] = audioBasicIO.readAudioFile("/Users/Kyle/Downloads/sample.rickyxsan - Insane.mp3");
F = audioFeatureExtraction.stFeatureExtraction(x, Fs, 0.050*Fs, 0.025*Fs);
plt.subplot(2,1,1); plt.plot(F[0,:]); plt.xlabel('Frame no'); plt.ylabel('ZCR');
plt.subplot(2,1,2); plt.plot(F[1,:]); plt.xlabel('Frame no'); plt.ylabel('Energy'); plt.show()
當我跑,我得到這個錯誤:當我嘗試 「命令PIP安裝eyed3」
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-6-d4b751ae9dc8> in <module>()
1 # GETTING FEATURES
2
----> 3 from pyAudioAnalysis import audioBasicIO
4 from pyAudioAnalysis import audioFeatureExtraction
5 import matplotlib.pyplot as plt
/Users/Kyle/Documents/School/Projects/SoundcloudProject/Tools/pyAudioAnalysis/audioBasicIO.py in <module>()
----> 1 import os, glob, eyed3, ntpath, shutil, numpy
2 import scipy.io.wavfile as wavfile
3 import pydub
4 from pydub import AudioSegment
5
ImportError: No module named eyed3
,我得到這樣的輸出:
Requirement already satisfied: eyed3 in /anaconda/lib/python3.5/site-packages
Requirement already satisfied: six in /anaconda/lib/python3.5/site-packages (from eyed3)
Requirement already satisfied: python-magic in /anaconda/lib/python3.5/site-packages (from eyed3)
Requirement already satisfied: pathlib in /anaconda/lib/python3.5/site-packages (from eyed3)
而且當我嘗試「brew install eyed3」時,我得到:
Warning: git-2.11.0 already installed, it's just not linked.
Error: Git must be installed and in your PATH!
Warning: eye-d3-0.7.8 already installed
它確實看起來像eyed3已經安裝,但我不知道如何讓我的筆記本找到它。
這是否幫助:https://stackoverflow.com/questions/32680081/importerror-after-successful-pip-installation/32680082#32680082 - 您的問題似乎是非常相似的。檢查你的jupyer內核屬於哪個python解釋器很重要。 – cel