I want to have project structure as you can see below: some API module, which i use to make some tools.
├── api
│ ├── __init__.py
│ ├── some_script.py
├── tools
│ └── tool1.py
api/some_script.py
def func():
print("Func1")
class some_object():
...
api/__init__.py
from .some_script import some_object, func
Where in tool1.py is
from ..api import func
I want that tools in folder, but I keep getting import error. To this point I had tool1.py in no folder and it worked fine (but with code from api import func)
ImportError: attempted relative import with no known parent package
How to make it work this way? Thanks for answers