python中ModuleNotFoundError错误
解决方法:https://www.cnblogs.com/dreamyu/p/7889959.html
在报错的模块中添加:
import sys
import os
curPath = os.path.abspath(os.path.dirname(file))
rootPath = os.path.split(curPath)[0]
sys.path.append(rootPath)
这样就可以解决了
python中ModuleNotFoundError错误
解决方法:https://www.cnblogs.com/dreamyu/p/7889959.html
在报错的模块中添加:
import sys
import os
curPath = os.path.abspath(os.path.dirname(file))
rootPath = os.path.split(curPath)[0]
sys.path.append(rootPath)
这样就可以解决了