The module written by myself cannot be recognized when importing in PyCharm

1. Problem description:

In the same directory, when multiple files are interdependent, import cannot recognize the module written by itself, and PyCharm prompts No Module.



2. Solution steps:

(1). Open File--> Setting—> Open the Python Console under Console, and click on the option (Add source roots to PYTHONPAT)


(2). Right-click on your workspace folder, find Mark Directory as and select Source Root, the problem is solved!


Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324476845&siteId=291194637