Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PYTHONPATH should be set explicitly #5

Open
Yu-Shi opened this issue Jul 14, 2020 · 1 comment
Open

PYTHONPATH should be set explicitly #5

Yu-Shi opened this issue Jul 14, 2020 · 1 comment

Comments

@Yu-Shi
Copy link

Yu-Shi commented Jul 14, 2020

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
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants