mvxm12
mvxm12

Reputation: 11

Unable to import a module thats already installed

I did pip freeze and the module was there in the list. Yet when I try to import it, getting the error below:

ModuleNotFoundError: No module named 'pyttsx3'

The virtual environment is activated too. I saw another thread regarding this same issue but it was too technical for me to understand.

What do I do now? I am a newbie to linux btw.

Upvotes: 1

Views: 173

Answers (1)

B.V.K
B.V.K

Reputation: 21

If you are using anaconda for virtual environment, it is possible that the pip file running your pip freeze command does not point to the pip executable within the environment. You can verify this by running which pip. If the resultant path does not contain your virtual environment name in it, it is likely that the issue is what I just mentioned above. The solution to that is to install pip inside your conda environment.

Ensure that you run the following commands after activating your conda environment.

conda install pip

now install whatever package you want using the pip install <package_name>

Upvotes: 1

Related Questions