import sys
import os
sys.path.append(os.path.split(os.path.abspath(os.path.dirname(file)))[0])
os.path.dirname #获取当前运行脚本的绝对路径
os.path.abspath(os.path.dirname(file)) #获取当前脚本的父路径的绝对路径
sys.path.append(os.path.split(os.path.abspath(os.path.dirname(file)))[0])
#将当前脚本的父路径的绝对路径添加到系统环境变量中再重新运行即可



