1if you encounter this error:
2
3ModuleNotFoundError: Cannot import name whatever
4
5with a python file called "whatever",
6then this might be cause by the following issues:
7 1. file "whatever" is not in the same folder as the current file.
8 this means that you need to place file "whatever" inside
9 the same file that gave you the import error.
10 2. library/module "whatever" is not installed.
11 if "whatever" is a third-party library/module,
12 then you need to install the library/module.
13 This is usually done with "pip install whatever",
14 but exceptions do exist that the command is not
15 the proper command to install "whatever"
16 3. if this file is in another folder, but you don't want to move it.
17 in this case, you should add this at the top of your file:
18 import sys
19 sys.path.append('path/to/file/whatever.py')
20 replace 'path/to/file' with the proper directory of "whatever.py"
21 4. you forgot to create "whatever.py"!
22 well... just remember to do that before importing.
23
24This does not include all of the possibilities. Hope this helped :D
1I guess either you didn't put any module in the target thing,
2Or you spelled the module name wrong,
3
4Or you tried to import a module from a different directory which somehow stuffed up.
5If the 3rd one is the case, check this out:
6https://stackoverflow.com/questions/2325923/how-to-fix-importerror-no-module-named-error-in-python