With this directory structure (this is a toy example, for brevity):
I have these simple modules:
When I try to run m.py, I get an error like
File "...\test\p2\two.py", line 1, in from ..p1 import one ImportError: attempted relative import beyond top-level package
What is the correct way to (relative) import module one into module two, when module one is in a package (p1) at the same level in the directory hierarchy as the package (p2) containing module two? I tried "from ..p1" since p1 is at the same dir level as p2, so "up 2 levels, down 1" fit my brain at first. I also tried "from .p1" and "from test.p1" but no joy.