如何访问子包的模块

How to access the module of a sub package

       parent/ 
                __init__.py 
              one/ 
                      __init__.py 
                      module1.py
              two/ 
                      __init__.py 
              three/ 
                      __init__.py 

从这个结构,我想访问module1.py

访问parent.one.module1 失败

您应该可以通过导入以下内容来访问 module1

import parent.one.module1
from parent.one import module1

从这里,您应该可以参考 module1

中的资产

如果有帮助请告诉我