Skip to content Skip to sidebar Skip to footer

Python ModuleNotFoundError Despite The Modules Being Installed

While importing: import speech_recognition as sr import pyttsx3 I get the error: ModuleNotFoundError: No module named 'speech_recognition' ModuleNotFoundError: No module named 'py

Solution 1:

Pls.run pip list in the same virtual env and check if your modules are present in the list.

Also, pls.run in the python terminal the same import first.


Solution 2:

I assume you are using Python 3 and your pip is installed and functional (you might need to use sudo or run command as admin, depending on your OS):

sudo pip uninstall speechrecognition
sudo pip install speechrecognition --no-cache-dir

And then:

sudo pip uninstall pyttsx3 
sudo pip install pyttsx3 --no-cache-dir

No cache dir option will make sure that you download dependencies from scratch in case your previous download in cache had any problems. It could also be that your are using a VENV or your Environment variables are messed up. Make sure which Python and Pip are you using:

python --version
pip -V

Post a Comment for "Python ModuleNotFoundError Despite The Modules Being Installed"