要导入上级目录,可以借助 sys库的path 加入上面两行就可以导入上级目录的库了 from sys import path path.append("..") from config import * 喜欢 (1)赏[]分享 (0)