stanford-futuredata / ColBERT

ColBERT: state-of-the-art neural search (SIGIR'20, TACL'21, NeurIPS'21, NAACL'22, CIKM'22, ACL'23, EMNLP'23)
MIT License
2.67k stars 355 forks source link

ImportError: cannot import name 'packaging' from 'pkg_resources' #350

Closed zhiyuanpeng closed 3 weeks ago

zhiyuanpeng commented 3 weeks ago

Hi,

I follow the readme to create conda env:

conda env create -f conda_env[_cpu].yml
conda activate colbert

and then install colbert through:

pip install colbert-ai

but I get error:

File "/opt/conda/envs/colbert/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 25, in <module>
    from pkg_resources import packaging  # type: ignore[attr-defined]
ImportError: cannot import name 'packaging' from 'pkg_resources'

when I run from colbert import Indexer. I have checked that setuptools and packaging are both installed and I can run:

import pkg_resources
print(pkg_resources.__file__)

Any suggestions? Thanks.

Best, Zhiyuan.

zhiyuanpeng commented 3 weeks ago

problem solved after downgrad setuptools from 70 to 69.5.1.