microsoft/ANCE

PYTHONPATH should be set explicitly

Opened this issue · 1 comments

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.

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.