二级目录下的运行main.py,找不到上级目录的解决方法 import os, sys sys.path.append(os.path.dirname(os.path.dirname(os.path.realpath(__file__))))