I try to access auditor folder from another folder like this
from auditor.evaluation.expected_behavior import SimilarGeneration
However, I get this error "No module named ‘auditor’"
I tried many ways like:
from ..auditor.evaluation.expected_behavior import SimilarGeneration
or
from .auditor.evaluation.expected_behavior import SimilarGeneration
and I also tried to add a sys path in order ro access this module. However, none of them worked for me.
I use Visual Studio Code as an IDE.
Do you have any suggestions?
Thanks a lot.
2
Answers
My supervisor solved this issue like that:
I do not know why but it works with this path.
You can add your folder to sys.path. Add this code at start of your file: