I have a folder that contains two other folders inside, like this:
training: |-- part1: |-- __init__.py |-- a.py |-- part2: |-- __init.py |-- b.py
when I want to import b.py in a.py, I get error. I’ve test two ways and get error in both of them explained here:
from training.part2.b import b
Exception has occurred: ModuleNotFoundError No module named 'training'
from ..part2.b import b
Exception has occurred: ImportError attempted relative import with no known parent package
can anyone help me to solve this problem? I will be very gratefull.
Source: Python Questions