pyAudioAnalysis
pyAudioAnalysis copied to clipboard
ImportError: No module named pyAudioAnalysis
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?
you can simply do a pip install pyAudioAnalysis
Cannot import 'ShortTermFeatures' from 'pyAudioAnalysis'
cannot import name 'ShortTermFeatures'
Cannot import 'ShortTermFeatures' from 'pyAudioAnalysis'
just remove (from 'pyAudioAnalysis') and just write (import 'ShortTermFeatures') from audioAnalysis.py file
@omarshaban32 can you explain more? I am unable to import ShortTermFeatures from audioAnalysis.py file.
@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)
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 -
- You should check is if you're installing it for the correct version of python. The recommended is 2.7 version of python.
- audioFeatureExtraction is inside ShortTermFeatures. You can call it like this -
info=ShortTermFeatures.feature_extraction()
and get ride ofimport audioFeatureExtraction
completely.