I'm trying to make a voice assistant with python in VSCode but have trouble. I installed all modules already, but one of the modules is not working. The gTTs(Google Text-to-Speech) make a error which is:
ModuleNotFoundError: No module named 'gtts'
I installed gTTs with pip installer in the terminal, again and again, but it did not happen anything. It just shows me:
"Requirement already satisfied"
import speech_recognition as sr
from gtts import gTTS
import os
import time
import playsound
def speak(text):
tts = gTTS(text=text, lang='en')
filename = 'jarvis_email_alert.mp3'
tts.save(filename)
playsound.playsound(filename)
speak("hello time")


PS C:\Users\huzey\OneDrive\Masaüstü\Python> & C:/Users/huzey/AppData/Local/Microsoft/WindowsApps/python3.8.exe
c:/Users/huzey/OneDrive/Masaüstü/Python/main.py
Traceback (most recent call last):
File "c:/Users/huzey/OneDrive/Masaüstü/Python/main.py", line 2, in <module>
from gtts import gTTS
ModuleNotFoundError: No module named 'gtts'
PS C:\Users\huzey\OneDrive\Masaüstü\Python>
How can I get the solution?
it might be that your pip is using a different python version than your script
you can use
python -m pip install gttsto installgttsto your python environment