PYTHONPATH should be set explicitly
Yu-Shi opened this issue · 1 comments
Yu-Shi commented
Hello,
I get this error when I follow the instructions to run the code:
File "drivers/run_warmup.py", line 14, in <module>
from utils.eval_mrr import passage_dist_eval
ModuleNotFoundError: No module named 'utils'
Users need to run this command before to eliminate that error:
export PYTHONPATH=${PYTHONPATH}:`pwd`
I suggest adding that command explicitly in README.md
.
robro612 commented
One can also go the __init__.py
route. I had success adding an empty __init__.py
file in each subdirectory that throws this sort of error (e.g. utils
). I'm not an expert with the new Python package logic, but I believe the __init__.py
file allows Python to make subdirectories recognizable/importable as packages as is done here.