grin icon indicating copy to clipboard operation
grin copied to clipboard

No module named 'lib'

Open Xieyangxinyu opened this issue 4 years ago • 1 comments

Hi,

I was trying to run python ./scripts/run_imputation.py --config config/grin/air36.yaml --in-sample False but I received the following error. Traceback (most recent call last): File "./scripts/run_imputation.py", line 16, in <module> from lib import fillers, datasets, config ModuleNotFoundError: No module named 'lib'

Is there an easy way to fix this?

Thank you very much!

Xieyangxinyu avatar Mar 15 '22 19:03 Xieyangxinyu

Hi,

You have to make the module lib somehow visible to the Python interpreter, there are many options to do that.

A quick way to do that is to add the repo to your PYTHONPATH before running the experiment, simply execute this in the grin folder

export PYTHONPATH=$PYTHONPATH:$(pwd)

before running the script.

An alternative is to run the script as a module by executing

python -m scripts.run_imputation --config config/grin/air36.yaml --in-sample False

Let me know if this helps!

Andrea

andreacini avatar Mar 16 '22 09:03 andreacini