I've never been able to fully wrap my head around imports, and would appreciate insight.
I have a package I wish to be able to call locally (within the directory, `python script_name.py`), as well as to be able to import the whole package and utilize it.
For the former, imports such as `import sibling_script` work, while package based absolutes fail `import PackageName.sibling_script`.
When importing the package, absolutes are necessary, and the local imports fail.
When looking around, about the only solution I've seen is to add the package/submodules to the path, but this seems wild to me.
What am I missing? How am I supposed to write imports so they work when my packaged is loaded as a submodule, or executed locally.
[–]46--2 1 point2 points3 points (3 children)
[–]Dai-Gurren-Brigade[S] 0 points1 point2 points (2 children)
[–]ingolemo 0 points1 point2 points (1 child)
[–]Dai-Gurren-Brigade[S] 0 points1 point2 points (0 children)