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

Cannot import MilvusClient without first setting MILVUS_URI environment variables to './milvus.db' #219

Open
zc277584121 opened this issue Oct 31, 2024 · 0 comments

Comments

@zc277584121
Copy link

Cannot import MilvusClient without first setting MILVUS_URI environment variables to './milvus.db'

MILVUS_URI=./milvus.db python -c "from pymilvus import MilvusClient"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/Users/zilliz/zilliz/langchain-milvus/libs/milvus/.venv/lib/python3.10/site-packages/pymilvus/__init__.py", line 33, in <module>
    from .milvus_client import MilvusClient
  File "/Users/zilliz/zilliz/langchain-milvus/libs/milvus/.venv/lib/python3.10/site-packages/pymilvus/milvus_client/__init__.py", line 2, in <module>
    from .milvus_client import MilvusClient
  File "/Users/zilliz/zilliz/langchain-milvus/libs/milvus/.venv/lib/python3.10/site-packages/pymilvus/milvus_client/milvus_client.py", line 22, in <module>
    from pymilvus.orm import utility
  File "/Users/zilliz/zilliz/langchain-milvus/libs/milvus/.venv/lib/python3.10/site-packages/pymilvus/orm/utility.py", line 26, in <module>
    from .connections import connections
  File "/Users/zilliz/zilliz/langchain-milvus/libs/milvus/.venv/lib/python3.10/site-packages/pymilvus/orm/connections.py", line 546, in <module>
    connections = Connections()
  File "/Users/zilliz/zilliz/langchain-milvus/libs/milvus/.venv/lib/python3.10/site-packages/pymilvus/orm/connections.py", line 58, in __call__
    cls.instance.__init__(*args, **kwargs)
  File "/Users/zilliz/zilliz/langchain-milvus/libs/milvus/.venv/lib/python3.10/site-packages/pymilvus/orm/connections.py", line 141, in __init__
    address, parsed_uri = self.__parse_address_from_uri(Config.MILVUS_URI)
  File "/Users/zilliz/zilliz/langchain-milvus/libs/milvus/.venv/lib/python3.10/site-packages/pymilvus/orm/connections.py", line 177, in __parse_address_from_uri
    raise ConnectionConfigException(message=f"{illegal_uri_msg.format(uri)}") from None
pymilvus.exceptions.ConnectionConfigException: <ConnectionConfigException: (code=1, message=Illegal uri: [./milvus.db], expected form 'http[s]://[user:password@]example.com[:12345]')>

Some high-level applications use environment variables to pass into Milvus settings, which cannot bypass this problem. Such as DocsGPT, or some tutorial

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

1 participant