0

I have the following project structure Project Structure

  • In utils.py I am importing a parse function form parser.py file like this

    from logica.parser.parser import parse

  • In builder.py I am importing a function from utils.py that uses the parser function like this

    from utils.utils import utils

When trying to run all this stuff I get a ModuleNotFoundError:

ModuleNotFoundError: No module named 'logica'

Do you guys have any ideas on how to resolve the issue?

Thanks

1 Answers1

0

In Python you can only import modules installed via pip or files stored in the same directory of the current file.


To solve this problem you can do this:

import sys
sys.path.append(<path-of-the-module>)

I would suggest to read also this.

FLAK-ZOSO
  • 3,873
  • 4
  • 8
  • 28