Jump to content

Module Not found error in python

Wictorian
Go to solution Solved by Wictorian,

Lol. The error was about my code.

It gives module not found error but it is installed. I double checked it and it says already satisfied.

 

I am running windows 10 and python 3.8

 

 

Link to comment
Share on other sites

Link to post
Share on other sites

What module are you trying to import?

____________________________________________________________________________________________________________________________________

 

 

____________________________________________________________________________________________________________________________________

pythonmegapixel

into tech, public transport and architecture // amateur programmer // youtuber // beginner photographer

Thanks for reading all this by the way!

By the way, my desktop is a docked laptop. Get over it, No seriously, I have an exterrnal monitor, keyboard, mouse, headset, ethernet and cooling fans all connected. Using it feels no different to a desktop, it works for several hours if the power goes out, and disconnecting just a few cables gives me something I can take on the go. There's enough power for all games I play and it even copes with basic (and some not-so-basic) video editing. Give it a go - you might just love it.

Link to comment
Share on other sites

Link to post
Share on other sites

Just now, pythonmegapixel said:

What module are you trying to import?

pyttsx3

Link to comment
Share on other sites

Link to post
Share on other sites

Just now, Sakuriru said:

We're going to need more details.

anything. just tell what

Link to comment
Share on other sites

Link to post
Share on other sites

Just now, Wictorian said:

pyttsx3

Have you by any chance saved the file you're trying to import it from as pyttsx3.py?

 

If you've done that, then you need to rename it, as it creates conflicts (i.e. your program tries to import itself)

____________________________________________________________________________________________________________________________________

 

 

____________________________________________________________________________________________________________________________________

pythonmegapixel

into tech, public transport and architecture // amateur programmer // youtuber // beginner photographer

Thanks for reading all this by the way!

By the way, my desktop is a docked laptop. Get over it, No seriously, I have an exterrnal monitor, keyboard, mouse, headset, ethernet and cooling fans all connected. Using it feels no different to a desktop, it works for several hours if the power goes out, and disconnecting just a few cables gives me something I can take on the go. There's enough power for all games I play and it even copes with basic (and some not-so-basic) video editing. Give it a go - you might just love it.

Link to comment
Share on other sites

Link to post
Share on other sites

3 minutes ago, pythonmegapixel said:

Have you by any chance saved the file you're trying to import it from as pyttsx3.py?

 

If you've done that, then you need to rename it, as it creates conflicts (i.e. your program tries to import itself)

nope. it is called simply "main.py"

Link to comment
Share on other sites

Link to post
Share on other sites

2 minutes ago, Sakuriru said:

Where are you seeing this error? Take a screenshot.

 

We don't have any context with your problem. Is this an IDE? The program itself?

I ran the .py file by clicking on it and it didnt do anything. so I ran it in an IDE and it said pyttsx3 module not found.

Link to comment
Share on other sites

Link to post
Share on other sites

15 minutes ago, Wictorian said:

nope. it is called simply "main.py"

OK. Could you do the following:

  1. Open the command prompt
  2. Type "python" and press enter
  3. You should see something like:
    Python 3.8.5 (Jul 20 2020, 15:57:54) [MSC v.1924 64 bit (AMD64)] on win32
    Type "help", "copyright", "credits" or "license" for more information.
    >>>
    
    
    

    Check that the python version displayed is the one you expect. (In your case it should be similar to mine, as you say you're using 3.8)

  4. Type after the ">>>" symbol, "import pyttsx3"

If you do that, do you get the same error?:

____________________________________________________________________________________________________________________________________

 

 

____________________________________________________________________________________________________________________________________

pythonmegapixel

into tech, public transport and architecture // amateur programmer // youtuber // beginner photographer

Thanks for reading all this by the way!

By the way, my desktop is a docked laptop. Get over it, No seriously, I have an exterrnal monitor, keyboard, mouse, headset, ethernet and cooling fans all connected. Using it feels no different to a desktop, it works for several hours if the power goes out, and disconnecting just a few cables gives me something I can take on the go. There's enough power for all games I play and it even copes with basic (and some not-so-basic) video editing. Give it a go - you might just love it.

Link to comment
Share on other sites

Link to post
Share on other sites

2 minutes ago, pythonmegapixel said:

OK. Could you do the following:

  1. Open the command prompt
  2. Type "python" and press enter
  3. You should see something like:
    
    Python 3.8.5 (Jul 20 2020, 15:57:54) [MSC v.1924 64 bit (AMD64)] on win32
    Type "help", "copyright", "credits" or "license" for more information.
    >>>
    
    
    

    Check that the python version displayed is the one you expect. (In your case it should be similar to mine, as you say you're using 3.8)

  4. Type after the ">>>" symbol, "import pyttsx3"

If you do that, do you get the same error?:

version is ok

I cant run the script you say, after importing, should I press some other key than enter?

Link to comment
Share on other sites

Link to post
Share on other sites

18 minutes ago, pythonmegapixel said:

OK. Could you do the following:

  1. Open the command prompt
  2. Type "python" and press enter
  3. You should see something like:
    
    Python 3.8.5 (Jul 20 2020, 15:57:54) [MSC v.1924 64 bit (AMD64)] on win32
    Type "help", "copyright", "credits" or "license" for more information.
    >>>
    
    
    

    Check that the python version displayed is the one you expect. (In your case it should be similar to mine, as you say you're using 3.8)

  4. Type after the ">>>" symbol, "import pyttsx3"

If you do that, do you get the same error?:

I cant get it to run. it doesnt give any erros, just display another line with >>>

Link to comment
Share on other sites

Link to post
Share on other sites

4 minutes ago, Wictorian said:

I cant get it to run. it doesnt give any erros, just display another line with >>>

That's the correct thing to happen, don't worry. The import command doesn't produce any output.

 

So which IDE are you running it in?

____________________________________________________________________________________________________________________________________

 

 

____________________________________________________________________________________________________________________________________

pythonmegapixel

into tech, public transport and architecture // amateur programmer // youtuber // beginner photographer

Thanks for reading all this by the way!

By the way, my desktop is a docked laptop. Get over it, No seriously, I have an exterrnal monitor, keyboard, mouse, headset, ethernet and cooling fans all connected. Using it feels no different to a desktop, it works for several hours if the power goes out, and disconnecting just a few cables gives me something I can take on the go. There's enough power for all games I play and it even copes with basic (and some not-so-basic) video editing. Give it a go - you might just love it.

Link to comment
Share on other sites

Link to post
Share on other sites

37 minutes ago, pythonmegapixel said:

That's the correct thing to happen, don't worry. The import command doesn't produce any output.

 

So which IDE are you running it in?

pycharm. normally I dont use an Ide. just use notepad. but when some bug happens, I handle it on the ide.

Link to comment
Share on other sites

Link to post
Share on other sites

3 minutes ago, Wictorian said:

pycharm. normally I dont use an Ide. just use notepad. but when some bug happens, I handle it on the ide.

ok I'm really not sure what's causing your issue... sorry about that

____________________________________________________________________________________________________________________________________

 

 

____________________________________________________________________________________________________________________________________

pythonmegapixel

into tech, public transport and architecture // amateur programmer // youtuber // beginner photographer

Thanks for reading all this by the way!

By the way, my desktop is a docked laptop. Get over it, No seriously, I have an exterrnal monitor, keyboard, mouse, headset, ethernet and cooling fans all connected. Using it feels no different to a desktop, it works for several hours if the power goes out, and disconnecting just a few cables gives me something I can take on the go. There's enough power for all games I play and it even copes with basic (and some not-so-basic) video editing. Give it a go - you might just love it.

Link to comment
Share on other sites

Link to post
Share on other sites

18 minutes ago, pythonmegapixel said:

ok I'm really not sure what's causing your issue... sorry about that

thanks anyway mate

Link to comment
Share on other sites

Link to post
Share on other sites

IF you are getting this error from within PyCharm the issue is likely with your interpreter.

You will need to ensure that the PyCharm interpreter has the module installed that you are wanting

To do this you can go under File/Preferences, then to Project:<your project name> and select Python Interpreter.
can go to the gear on the far right and click it and then the add option
image.thumb.png.b964d188e45ac354b58f980346a76021.png

 

From there you If you have installed the module to your system python and it is in fact working you can change the option on the left from Virtual


image.png.49e10a27b8b6b0008856e6b9ba3d4367.png

 

image.png.bd53f405fcf25207144a3dda6901978b.png

 

once you have done that then the import should work form inside of the PyCharm Python Console

I hope this helps

Cheers

Josh

Dragoby.com

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×