Below is my file directory
.
├── README.md
├── func
│ ├── __init__.py
│ ├── main.py
│ └── requirements.txt
└── utils
├── __init__.py
├── abc.py
└── def.py
abc.py
def test():
return 'berjaya'
main.py
from ..utils import test
when I run python main.py
get an error ImportError: attempted relative import with no known parent package
how to solve the issue?
In main.py
i have tried a few ways
- from .utils import test
- from ..utils import test
All got the same error