Search code examples
pythonpyttsx3

I get import error after importing pyttsx3


I've been making simple "voice assistant". I imported pyttx3 using pip install pyttx3(and yes i added import pyttsx3 in the code), which successfully installed due to terminal outprint Successfully installed pyttsx3-2.90 but then when i try to run the code i get File "c:\Users\teeki\voiceassistant\va.py", line 1, in <module> import pyttsx3 ImportError: No module named pyttsx3

I already tried to lookup the problem, found some solutions, which didnt do anything for me. Some of things i tried:

  1. reinstalling pyttsx3 with pip uninstall pyttsx3 then installing it again
  2. Installing it with pipenv
  3. Changing python interpeter back and forth to 2.7, 3.8, 3.9

EDIT:im using visual studio code


Solution

  • You can try py -m pip install pyttsx3. Also, make sure that it is installed into your PATH.

    If that doesn't work, try pip3 install pyttsx3.