程序报错内容:
Traceback (most recent call last):
File "code/nli_inference/veracity_prediction.py", line 10, in <module>
from code.utils.data_loader import read_json
ModuleNotFoundError: No module named 'code.utils'; 'code' is not a package
解决方案:
在终端输入下列代码,将当前路径添加到 PYTHONPATH 中,让 Python 知道在哪里可以找到模块。在终端输入下列代码后,按回车键即可:
bash
export PYTHONPATH=$(pwd):$PYTHONPATH