I'm having trouble with relative imports, but I think its because i'm not understanding package structure completely.
For example, here is my package structure.
neo_autorig/ Source folder, Top level
__init__.py
basic/ Subpackage for basic utiltites for the script
__init__.py
name.py
name_test.py
module_locator.py
Theres more than this, but this is basically what i'm using for imports
In name.py i'm importing module locator using
from .. import module_locator
But it says
# Error: line 1: Attempted relative import beyond toplevel package
Are top level scripts (like my main script/ui used to execute everything) supposed to go in the top source folder in the eclipse package? Or am i setting this up wrong. There are also other sub packages in the source folder, each with scripts in them.
Edit: If i putanother package in a sub package, I can relative import, its only the case where i cant relative import from a sub package to a top level package, and the scripts source is in my python path.