I have been trying for a couple of days to solve the relative import error in my project with no success. I have the following project tree:
proj
|
|---__init__.py
|
|---lib
| |---__init__.py
| |---func.py
|
|---src
| |---main.py
the
__init__.py
is an empty file.the
func.py
contains a print function:def hello_func(): print("Hello !!!")
the
main.py
:from ..lib import * hello_func()
and when I run it I receive this error:
ImportError: attempted relative import with no known parent package
did anybody face the same problem?