1、pycharm報錯信息:
from .bird_base import BirdBase
ModuleNotFoundError: No module named '__main__.bird_base'; '__main__' is not a package
2、目錄結構:
3、解決方法:
將相對路徑改為絕對路徑:
from .bird_base import BirdBase------改為-----> from python_learning.bird_base import BirdBase