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

[Bug]: ModuleNotFoundError: No module named 'scipy' #2033

Open
JakeSummers opened this issue Apr 11, 2024 · 0 comments
Open

[Bug]: ModuleNotFoundError: No module named 'scipy' #2033

JakeSummers opened this issue Apr 11, 2024 · 0 comments
Labels
kind/bug Something isn't working

Comments

@JakeSummers
Copy link

JakeSummers commented Apr 11, 2024

Describe the bug

Importing almost anything from pymilvus, for example:

from pymilvus import Collection

Results in an exception being raised:

  File "/Users/jacob.summers/repos/ads-korok-pipeline/korok_inference/datamodels/request_context.py", line 5, in <module>
    from pymilvus import Collection
  File "/Users/jacob.summers/Library/Caches/pypoetry/virtualenvs/korok-inference-jyWwJgRH-py3.10/lib/python3.10/site-packages/pymilvus/__init__.py", line 30, in <module>
    from .client.abstract import AnnSearchRequest, Hit, Hits, RRFRanker, SearchResult, WeightedRanker
  File "/Users/jacob.summers/Library/Caches/pypoetry/virtualenvs/korok-inference-jyWwJgRH-py3.10/lib/python3.10/site-packages/pymilvus/client/abstract.py", line 10, in <module>
    from . import entity_helper
  File "/Users/jacob.summers/Library/Caches/pypoetry/virtualenvs/korok-inference-jyWwJgRH-py3.10/lib/python3.10/site-packages/pymilvus/client/entity_helper.py", line 7, in <module>
    from scipy import sparse
ModuleNotFoundError: No module named 'scipy'

Root cause

It looks like this issue was introduce somewhere between 2.3.7 and 2.4.0.

In version2.4.0 scipy is imported in pymilvus/client/entity_helper.py despite the fact that scipy is not listed as a dependency of pymilvus:

$ poetry show pymilvus
 name         : pymilvus
 version      : 2.4.0
 description  : Python Sdk for Milvus

dependencies
 - azure-storage-blob *
 - environs <=9.5.0
 - grpcio >=1.49.1,<=1.60.0
 - minio >=7.0.0
 - pandas >=1.2.4
 - protobuf >=3.20.0
 - pyarrow >=12.0.0
 - requests *
 - setuptools >=67
 - ujson >=2.0.0

Workaround

Install scipy via poetry add scipy or pip ....

@JakeSummers JakeSummers added the kind/bug Something isn't working label Apr 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant