pycharm运行没问题,但是terminal运行找不到自定义的包
rootpath = str("当前工程的根目录")
syspath = sys.path
sys.path = []
sys.path.append(rootpath)
sys.path.extend([rootpath + i for i in os.listdir(rootpath) if i[0] != "."])
sys.path.extend(syspath)
亲测有效!!!
rootpath = str("当前工程的根目录")
syspath = sys.path
sys.path = []
sys.path.append(rootpath)
sys.path.extend([rootpath + i for i in os.listdir(rootpath) if i[0] != "."])
sys.path.extend(syspath)
亲测有效!!!