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

ModuleNotFoundError: No module named 'utility' #101

Closed
lalenzos opened this issue Apr 6, 2022 · 7 comments
Closed

ModuleNotFoundError: No module named 'utility' #101

lalenzos opened this issue Apr 6, 2022 · 7 comments

Comments

@lalenzos
Copy link

lalenzos commented Apr 6, 2022

Hi,
I wanted to use your model in my python project and added it therefore to my project (virtual pip env) by using the following command:

pip install git+https://github.com/stanford-futuredata/ColBERT

However, when I start my python project and wanted to use your demo code from the demo notebook, I'm always getting the following error:

Traceback (most recent call last):
  File "C:\backend\webservice.py", line 8, in <module>
    from controllers.colbert_controller import ColBertController
  File "C:\backend\controllers\colbert_controller.py", line 3, in <module>
    from colbert.infra import Run, RunConfig, ColBERTConfig
  File "C:\backend\venv\lib\site-packages\colbert\__init__.py", line 1, in <module>
    from .trainer import Trainer
  File "C:\backend\venv\lib\site-packages\colbert\trainer.py", line 1, in <module>
    from colbert.infra.run import Run
  File "C:\backend\venv\lib\site-packages\colbert\infra\__init__.py", line 1, in <module>
    from .run import *
  File "C:\backend\venv\lib\site-packages\colbert\infra\run.py", line 7, in <module>
    from colbert.infra.config import RunConfig
  File "C:\backend\venv\lib\site-packages\colbert\infra\config\__init__.py", line 1, in <module>
    from .config import *
  File "C:\backend\venv\lib\site-packages\colbert\infra\config\config.py", line 3, in <module>
    from .base_config import BaseConfig
  File "C:\backend\venv\lib\site-packages\colbert\infra\config\base_config.py", line 11, in <module>
    from utility.utils.save_metadata import get_metadata_only
ModuleNotFoundError: No module named 'utility'

Any idea how to solve this error? Thanks.

@okhat
Copy link
Collaborator

okhat commented Apr 18, 2022

We're planning to make improvements to how the package works with pip.

In the meanwhile, please follow the import approach shown at the top of the intro notebook: https://github.com/stanford-futuredata/ColBERT/blob/new_api/docs/intro.ipynb

(Also, don't pip install the git repo. Instead, follow the installation instructions on the README of the branch you're using. We recommend conda.)

@luffycodes
Copy link

luffycodes commented Apr 21, 2022

i used python setup.py install, and i get the same error !

@okhat
Copy link
Collaborator

okhat commented Apr 21, 2022

@luffycodes Please follow the instructions on the README for installation. Don't use the setup script directly.

@luffycodes
Copy link

conda env create -f conda_env.yml
conda activate colbert-v0.2

are these the commands to install colbert?

@okhat
Copy link
Collaborator

okhat commented Apr 25, 2022

@luffycodes Which branch do you want to install? From your other issues, I assume you're interested in ColBERTv2. In that case, please check the README for the new_api branch. From there, you can install the conda environment (it's different from ColBERTv1) and then check that you're able to execute the code in the example notebook.

@luffycodes
Copy link

I was interested in training v2 from scratch ! I think it is addressed in the other issue :)

Thanks a lot for the help and prompt reply :)

@okhat
Copy link
Collaborator

okhat commented Apr 27, 2022

Thanks, @luffycodes ! Let me know if the commands for installation on the new_api branch and the corresponding ColBERTv2 notebook don't work for you.

@okhat okhat closed this as completed Nov 16, 2022
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