[Solved] ModuleNotFoundError: No module named ‘xxx’; ‘xxx’ is not a package

ModuleNotFoundError: No module named ‘xxx’; ‘xxx’ is not a package
Error.
ModuleNotFoundError: No module named ‘xxx’; ‘xxx’ is not a package
When debugging the script via pycharm, the following error occurs:
ModuleNotFoundError: No module named ‘xml.parser’; ‘xml’ is not a package
Cause.
project
|– xml
|– xml.py
Package name and .py file conflict
Solution.
Change the package name and the .py file name to be inconsistent

Read More: