我的python项目中具有以下包结构
wolv
|---car
|---cos
|---
__init__.py
utils.py
manager.py
|---providers
|---sl.py
| **utils.py**
| config.py
|__init__.py
在wolv.car.utills.py
中我可以执行from wolv.car import config
,但不能执行from wolv.car.cos import manager
任何原因为什么会发生,以及如何在wolv.car.utills.py
中导入管理器
跟踪是:
Traceback (most recent call last):
File "/usr/local/bin/wvbar-utils", line 6, in <module>
from wolv.car.utils import main
File "/usr/local/lib/python2.7/site-packages/wolv/car/utils.py", line 31, in <module>
from wolv.car.cos import manager
File "/usr/local/lib/python2.7/site-packages/wolv/car/cos/manager.py", line 10, in <module>
from wolv.car.cos.providers import sl
File "/usr/local/lib/python2.7/site-packages/wolv/car/cos/providers/sl.py", line 21, in <module>
from wolv.car import utils
ImportError: cannot import name utils
manager.py具有from wolv.car.cos.providers import sl
,而sl.py具有from wolv.car import utils