Since python 3.3, implicit namespace packages are supported, so that I can have two packages:
a
├── b
├── __init__.py
a
├── c
├── __init__.py
and import a.b
and a.c
without problems. But it seems that I can only do it with pip install
; if I only create an egg of either package and add the egg path into sys.path
, the module cannot be loaded:
import sys
sys.path.append('./a-b.egg')
import a.b # ModuleNotFoundError: No module named 'a.b'