ImportError: No module named 'pydub'
Question:
I am creating a simple script that will use pydub
to fetch files from a directory based on their name, then stitch a few of them together and export the result.
I had the script working great in a Windows environment (Win 7, python 3.4), but now I’m trying to run on OSX.
I have installed all necessary components – ffmpeg
, libav
. I have just installed pydub
with pip
, pulling directly from github.
My file starts with the input statement from pydub import AudioSegment
, and this is what I get:
Traceback (most recent call last):
File "functions.py", line 2, in <module>
from pydub import AudioSegment
ImportError: No module named 'pydub'
Thoughts? What am I missing? Any help is greatly appreciated!
Answers:
Check out PEP 0394. You might be running $ python functions.py
when you need to be running $ python3 functions.py
. If that’s the case, make sure you $ pip3 install pydub
, otherwise OSX will not add the package to the right python version.
If you are using Python 2, just run
pip2 install pydub
Try running the below command in your terminal,
pip install pydub
I got the same issue after installing the pydub vai:
pip install pydub
then I use both via pip and pip3 and error gone
pip 3 install pydub
pip install pydub
Try to install with pip3
pip3 install pydub
for me none of the above worked. I had to completely delete all instances of anaconda.
All instances of python.
And then reinstall python and reinstall jupyter notebooks. And then it started working and the pydub package reinstalled and the import started working.
I am creating a simple script that will use pydub
to fetch files from a directory based on their name, then stitch a few of them together and export the result.
I had the script working great in a Windows environment (Win 7, python 3.4), but now I’m trying to run on OSX.
I have installed all necessary components – ffmpeg
, libav
. I have just installed pydub
with pip
, pulling directly from github.
My file starts with the input statement from pydub import AudioSegment
, and this is what I get:
Traceback (most recent call last):
File "functions.py", line 2, in <module>
from pydub import AudioSegment
ImportError: No module named 'pydub'
Thoughts? What am I missing? Any help is greatly appreciated!
Check out PEP 0394. You might be running $ python functions.py
when you need to be running $ python3 functions.py
. If that’s the case, make sure you $ pip3 install pydub
, otherwise OSX will not add the package to the right python version.
If you are using Python 2, just run
pip2 install pydub
Try running the below command in your terminal,
pip install pydub
I got the same issue after installing the pydub vai:
pip install pydub
then I use both via pip and pip3 and error gone
pip 3 install pydub
pip install pydub
Try to install with pip3
pip3 install pydub
for me none of the above worked. I had to completely delete all instances of anaconda.
All instances of python.
And then reinstall python and reinstall jupyter notebooks. And then it started working and the pydub package reinstalled and the import started working.