matsui528 / nanopq

Pure python implementation of product quantization for nearest neighbor search
MIT License
327 stars 43 forks source link

Import importlib.util #3

Closed Hiroshiba closed 5 years ago

Hiroshiba commented 5 years ago

I cannot import nanopq.

$ python -c "import nanopq"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/my/python3.6/site-packages/nanopq/__init__.py", line 6, in <module>
    from .convert_faiss import nanopq_to_faiss, faiss_to_nanopq
  File "/my/python3.6/site-packages/nanopq/convert_faiss.py", line 3, in <module>
    spec = importlib.util.find_spec("faiss")
AttributeError: module 'importlib' has no attribute 'util'

It looks like this.

python -c "import importlib; importlib.util"  # error
# ↓
python -c "import importlib.util; importlib.util"  # no error

Your project's CI uses pytest, and pytest contains meny import importlib.util. https://github.com/pytest-dev/pytest/search?q=importlib&unscoped_q=importlib So, maybe an error does not occur at CI test.

matsui528 commented 5 years ago

@Hiroshiba Thanks! I updated the package on pypi as well. Now you can pip install the latest version and it should work well :+1: