Open Valuebai opened 4 years ago
解决方案:在run_test.py文件最前面加上以下代码,必须放在所有improt之前!!!!!
import sys import os curPath = os.path.abspath(os.path.dirname(file)) rootPath = os.path.split(curPath)[0] sys.path.append(rootPath)
或者 import sys sys.path.append('..') 在from xxx import之前加上这句
解决方案:在run_test.py文件最前面加上以下代码,必须放在所有improt之前!!!!!
import sys import os curPath = os.path.abspath(os.path.dirname(file)) rootPath = os.path.split(curPath)[0] sys.path.append(rootPath)