1、在需要导入别的类包中加入这两行代码 BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))sys.path.append(BASE_DIR) 相关文章: 2021-10-26 2021-11-23 2022-02-26 2021-11-18 2021-09-05 2022-12-23 2022-12-23 2022-12-23