Solve the problem of pychar import error

Question:
Pycharm shows those classes that cannot be referenced, even if they are in the project.
Analysis:
Pycharm defaults the project’s root directory to the source directory, so if the import USES an absolute path instead of a relative path, it will be looked up in the project’s root directory, not the project’s own root directory.
Methods:
Set the root directory of the item in Pycharm:
The file – & gt; Setting – & gt; Project: server – & gt; project structure
Set the path to Source in the root directory of the project.

Read More: