pyAudioAnalysis icon indicating copy to clipboard operation
pyAudioAnalysis copied to clipboard

ImportError: No module named pyAudioAnalysis

Open cylinnn opened this issue 4 years ago • 7 comments

I have added export PYTHONPATH=$PYTHONPATH:"/home/pi" in the .bashrc file,and type source ~/.bashrc. And I'm pretty sure my library is in the /home/pi folder. But it still shows " ImportError: No module named pyAudioAnalysis". Can anyone teach me?

cylinnn avatar Sep 26 '19 06:09 cylinnn

you can simply do a pip install pyAudioAnalysis

DerekChia avatar Nov 04 '19 11:11 DerekChia

Cannot import 'ShortTermFeatures' from 'pyAudioAnalysis'

nehapawar992 avatar Feb 04 '20 06:02 nehapawar992

cannot import name 'ShortTermFeatures'

omarshaban32 avatar Feb 11 '20 21:02 omarshaban32

Cannot import 'ShortTermFeatures' from 'pyAudioAnalysis'

just remove (from 'pyAudioAnalysis') and just write (import 'ShortTermFeatures') from audioAnalysis.py file

omarshaban32 avatar Feb 11 '20 22:02 omarshaban32

@omarshaban32 can you explain more? I am unable to import ShortTermFeatures from audioAnalysis.py file.

AsimFayyazRaja avatar Mar 04 '20 15:03 AsimFayyazRaja

@omarshaban32 can you explain more? I am unable to import ShortTermFeatures from audioAnalysis.py file.

pyAudioAnalysis 0.2.5 changes a lot you can write as below

from pyAudioAnalysis import audioBasicIO from pyAudioAnalysis.audioFeatureExtraction import stFeatureExtraction import matplotlib.pyplot as plt [Fs, x] = audioBasicIO.readAudioFile("./train/1-100032-A-0.wav") F, f_names = stFeatureExtraction(x, Fs, 0.050Fs, 0.025Fs)

zhaoyun0071 avatar Mar 11 '20 02:03 zhaoyun0071

Just make sure your files are installed properly. Your main.py file should be place alongside pyaudioanalysis folder which contains all the python modules - audioBasicIO or ShortTermFeatures, etc. Then you can successfully run - from pyAudioAnalysis import audioBasicIO from pyAudioAnalysis import ShortTermFeatures

Note -

  1. You should check is if you're installing it for the correct version of python. The recommended is 2.7 version of python.
  2. audioFeatureExtraction is inside ShortTermFeatures. You can call it like this - info=ShortTermFeatures.feature_extraction() and get ride of import audioFeatureExtraction completely.

minalmeg avatar Aug 28 '20 20:08 minalmeg