I am unable to import external modules in python. Python is showing error: ModuleNotFoundError

Whenever I try to import pyttsx3, it shows error:

>>> import pyttsx3
Traceback (most recent call last):
  File "<pyshell#0>", line 1, in <module>
    import pyttsx3
ModuleNotFoundError: No module named 'pyttsx3'
>>> 

And when i try to download it in pip:

C:\Users\atharva>pip install pyttsx3
Requirement already satisfied: pyttsx3 in c:\users\sai\anaconda\lib\site-packages (2.71)
Requirement already satisfied: pypiwin32; "win32" in sys_platform in c:\users\sai\anaconda\lib\site-packages (from pyttsx3) (223)
Requirement already satisfied: pywin32>=223 in c:\users\sai\anaconda\lib\site-packages (from pypiwin32; "win32" in sys_platform->pyttsx3) (227)

It happens to me every time when I try to import modules like pyttsx3, tensorflow, pytorch, and many more.

>>> import pyttsx3
Traceback (most recent call last):
  File "<pyshell#0>", line 1, in <module>
    import pyttsx3
ModuleNotFoundError: No module named 'pyttsx3'
>>> import tensorflow as tf
Traceback (most recent call last):
  File "<pyshell#1>", line 1, in <module>
    import tensorflow as tf
ModuleNotFoundError: No module named 'tensorflow'
>>> from __future__ import print_function
>>> import torch
Traceback (most recent call last):
  File "<pyshell#4>", line 1, in <module>
    import torch
ModuleNotFoundError: No module named 'torch'
>>> 

I am helpless please help me :frowning:

You’ve installed pyttsx3 in the anaconda packages…
Try with the anaconda interpreter, it should work with it…

1 Like

You are god you are right, I tried to run it in jupyter notebook and guess what it worked, I am so glad. But one more problem, how to transfer in python so that I can run it in IDLE or Visual Studio Community 2019.