relative-beyond-top-level / E0402#
Attempted relative import beyond top-level package
Used when a relative import tries to access too many levels in the current package.
from ................antigravity import NGField # [relative-beyond-top-level]
from physic.antigravity import NGField
# Right number of dots in the import: you needed 15 dots, not 16, duh. # from ...............antigravity import NGField
Absolute imports were strongly preferred, historically. Relative imports allow you to reorganize packages without changing any code, but these days refactoring tools and IDEs allow you to do that at almost no cost anyway if the imports are explicit/absolute. Therefore, absolute imports are often still preferred over relative ones.
Created by the imports checker.