[Solved] Pycharm from xx import xx Error: Unresolved reference

There is a problem: the related classes cannot be referenced, but these classes are indeed in the project

Analysis reason: import failed because the path does not correspond. Pycharm defaults to the source directory as the root directory of the project


Search the corresponding item searchtest and select “sources”; Finally, be sure to “apply”

Set the folder where the package is placed as source, so that the module class of import can be found through these source folders as the root path, that is, find the imported things in these source folders


Read More: