Home > other >  ModuleNotFound error is thrown during debug mode even though folder is present in Intellij IDEA for
ModuleNotFound error is thrown during debug mode even though folder is present in Intellij IDEA for

Time:10-06

From the past one week am facing ModuleNotFound error in Intellij for a python project even though the module is present. I tried several troubleshooting methods.

  1. I have added Absolute imports
  2. I have set the correct python interpreter
  3. Cleared the intelliJ cache and rebuilt the indexes.... still unable to get it fixed.

Please help me resolve this

enter image description here

CodePudding user response:

Have you checked if the path is in sys.path?

import sys
sys.path

If the path of the directory your module are missing there simply add it by using

sys.path.append('yourpath/')

Let me know if it worked

CodePudding user response:

Does it help to mark the folder as "Test Source Root"? Please feel free to submit a request at https://youtrack.jetbrains.com/issues/PY with a simplified project zipped attached and steps to reproduce.

  • Related