0

PyCharm highlights lines of importing modules (only made by me modules) with red wavy line and give warning "Unresolved reference 'module_name'". But they all (my modules) are located in common package "main". In spite of this unexpected behavior, code is executed correctly.

On linked picture, you can see code/project tree/warning

How to avoid this warnings?

picture of code; project tree; warnings

  • 1
    Please add your code, project tree and warnings as text, not as an image. – funie200 Jul 24 '20 at 12:17
  • Please read [How to Ask](https://stackoverflow.com/help/how-to-ask) and also [Please add a Minimal Reproducible Example](https://stackoverflow.com/help/minimal-reproducible-example) that illustrates your issue. – Venkatesh Wadawadagi Jul 24 '20 at 12:30

1 Answers1

1

On the left pane, you should define where the root directory of your code it is.

Go to relevant directory (on left pane), right click on the mouse, on bottom you have mark directory as and then select "source root".

You may select various roots, in case of documentation (the python building scripts), testing, or also some utility tools. But you should explicitly tell PyCharm were the main directory of the project it is.

Giacomo Catenazzi
  • 8,519
  • 2
  • 24
  • 32