0

I'm trying to use the pyAudioAnalysis library to pull features from mp3 files. The problem I'm having is that I can't get my Jupyter Notebook to find eyed3, which is essential for the library. Here's my code :

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()

When I run that I get this error:

---------------------------------------------------------------------------
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

When I try "sudo pip install eyed3", I get this output:

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)

And when I try "brew install eyed3", I get this:

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

It really seems like eyed3 is already installed, but I'm not sure how to get my notebook to find it.

Anil_M
  • 10,893
  • 6
  • 47
  • 74
Kyle Frye
  • 111
  • 1
  • 11
  • does this help: https://stackoverflow.com/questions/32680081/importerror-after-successful-pip-installation/32680082#32680082 - your problem seems to be very similar. It's important to check to which python interpreter your jupyer kernel belongs. – cel Nov 11 '17 at 12:22

1 Answers1

0

cel is right, it looks like the interpreter that is installing your library is different from the one that jupyter is using. This makes sense since you are doing sudo pip install instead of just pip install. I'm guessing the library is being installed by a version of pip linked that is accessible to the administrator but not your local account.

Try using one of the following:

python -m pip install eyed3

or

pip install eyed3 --user

It could also be that the environment your jupyter notebook is using is set up using conda. In this case use:

conda install eyed3
amanbirs
  • 1,078
  • 6
  • 11
  • Thank you for the response. When I try the first two, I get a huge list of "Requirement already satisfied"s. When I try the third I get this: `Fetching package metadata ........... PackageNotFoundError: Packages missing in current channels: - eyed3` I'm not sure if it's relevant, but I'm working in python 2.7. Actually, I just found out that I can import eyed3 when I'm in the default python, but not in 2.7. – Kyle Frye Nov 12 '17 at 07:13