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

import lib ModuleNotFoundError: No module named 'lib' #44

Open
ammarsaf opened this issue Oct 12, 2024 · 2 comments
Open

import lib ModuleNotFoundError: No module named 'lib' #44

ammarsaf opened this issue Oct 12, 2024 · 2 comments

Comments

@ammarsaf
Copy link

ammarsaf commented Oct 12, 2024

I have run the requirements.txt file, and try to execute the code using your CLI.

But it showed this error
import lib ModuleNotFoundError: No module named 'lib'

I check the source code, there is line of
import lib

What does this lib-library is? Is it your internal library, or dependencies that I need to install?


Update:
I found that you should import it from util.py. The import should be from lib.util import *

@sadjadeb
Copy link

You must run the following lines to add the lib into the path:

export REPO_DIR=/path/to/the/repo/dir
cd $REPO_DIR

conda env config vars set PYTHONPATH=${PYTHONPATH}:${REPO_DIR}
conda env config vars set PROJECT_DIR=${REPO_DIR}

@celsofranssa
Copy link

Or you can just set the PYTHONPATH before tuning, training and eval:

export PYTHONPATH=$PYTHONPATH:$(pwd) # where pwd is the project dir

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

3 participants