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.
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.
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
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.
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.