milvus-io / milvus

A cloud-native vector database, storage for next generation AI applications
https://milvus.io
Apache License 2.0
27.28k stars 2.63k forks source link

[Bug]: No module named 'milvus_model' #32691

Closed weiyi88 closed 3 weeks ago

weiyi88 commented 3 weeks ago

Is there an existing issue for this?

Environment

- Milvus version:
- Deployment mode(standalone or cluster):
- MQ type(rocksmq, pulsar or kafka):    
- SDK version(e.g. pymilvus v2.0.0rc2):
- OS(Ubuntu or CentOS): 
- CPU/Memory: 
- GPU: 
- Others:

Current Behavior

when i use this code ` from pymilvus import model

openai_ef = model.dense.OpenAIEmbeddingFunction( model_name='text-embedding-3-large', # Specify the model name api_key='YOUR_API_KEY', # Provide your OpenAI API key dimensions=512 # Set the embedding dimensionality ) ` and have that error

Expected Behavior

have error , ande i run pip install pymilvus[model]

have another error

zsh: no matches found: pymilvus[model]

Steps To Reproduce

1,copy code
2,run python
3,reappear

Milvus Log

(llamaindex) (base) bluefocus_work@ringdeMacBook-Air autoGen % python main.py Traceback (most recent call last): File "/Users/bluefocus_work/miniconda3/envs/llamaindex/lib/python3.10/site-packages/pymilvus/model/init.py", line 24, in _load_milvus_model import milvus_model ModuleNotFoundError: No module named 'milvus_model'

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/Users/bluefocus_work/Desktop/work/program/python/autoGen/main.py", line 7, in from app.routers import V1 File "/Users/bluefocus_work/Desktop/work/program/python/autoGen/app/routers.py", line 5, in from app.api.milvus import router as milvus_router File "/Users/bluefocus_work/Desktop/work/program/python/autoGen/app/api/milvus.py", line 3, in from app.service.milvus_service import MilvusService File "/Users/bluefocus_work/Desktop/work/program/python/autoGen/app/service/milvus_service.py", line 9, in class MilvusService: File "/Users/bluefocus_work/Desktop/work/program/python/autoGen/app/service/milvus_service.py", line 14, in MilvusService openai_ef = model.dense.OpenAIEmbeddingFunction( File "/Users/bluefocus_work/miniconda3/envs/llamaindex/lib/python3.10/site-packages/pymilvus/model/init.py", line 10, in getattr self._load_milvus_model() File "/Users/bluefocus_work/miniconda3/envs/llamaindex/lib/python3.10/site-packages/pymilvus/model/init.py", line 33, in _load_milvus_model raise ImportError(err_str) from e ImportError: The 'milvus_model' package is not installed. For installation, use 'pip install pymilvus[model]'. For more information, please visit https://github.com/milvus-io/milvus-model.

Anything else?

No response

yanliang567 commented 3 weeks ago

/assign @wxywb please help to take a look /unassign

sre-ci-robot commented 3 weeks ago

@yanliang567: GitHub didn't allow me to assign the following users: wxywb.

Note that only milvus-io members, repo collaborators and people who have commented on this issue/PR can be assigned. Additionally, issues/PRs can only have 10 assignees at the same time. For more information please see the contributor guide

In response to [this](https://github.com/milvus-io/milvus/issues/32691#issuecomment-2081952466): >/assign @wxywb >please help to take a look >/unassign Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.
wxywb commented 3 weeks ago

@weiyi88 for zsh, you need to use

pip install "pymilvus[model]"
weiyi88 commented 3 weeks ago

image focus i have do this way ,and nothing help

weiyi88 commented 3 weeks ago

@weiyi88对于zsh,你需要使用

pip install“pymilvus[model]“

unbelieveable it work , But the pip prompt is pip install pymilvus[model]. This does not work. Can you improve the prompt or annotate it in the document