Why i am getting error in importing this module in pthon program

The ModuleNotFoundError is raised when Python cannot locate an error. The most common cause of this error is forgetting to install a module or importing a module incorrectly. If you are working with an external module, you must check to make sure you have installed it.

Hello @yuvraj.khatri107314,
Looking at your code, there is no import error for the library but an indentation error in your code. Just remove the space before the 2nd line and I think it should run. After doing that if it specifies ModuleNotFoundError then, try installing the particular library in python.
Regards,
Mrudula

Hi @yuvraj.khatri107314
The ModuleNotFoundError is showed when you are importing the module using the wrong path or wrongly spelled the module name. Also module names are case sensitive.
But in your code, error showing is indentation error. So, remove the space at the beginning of the 2nd line and try it again.
Hope, it’ll help.

This Is Because Of The Space You Given Before Calling playsound(‘’) in 2nd line

1 Like

Hi, here I check your error that’s I find the indentation
Error.so please correct your second line ,and run.
If again come error in your program like ModulenotFound then please installed your pip
And import them.

ModuleNotFoundError occurs when you import a module using an incorrect path or a misspelled module name. installed your pip and imported them. If you are working with an external module, you need to check that you have installed it. Module names are also case sensitive. But in your code the error shown is an indentation error. So remove the space at the beginning of the 2nd line and try again.
I hope it will be enough.

HI! @yuvraj.khatri107314
As we have learned that python use indentation to indicate a block of code. But indentation is not required at line 2 when we are providing the link inside “playsound” module. That’s why it shows an indentation error in your code. So just by removing the indentation will fix the error.