BUG:ModuleNotFoundError: No module named ‘milvus_lite‘

当我们在windows 使用milvus 数据库构建RAG,出现一个包一直安装不上。

复制代码
from pymilvus import MilvusClient
milvus_client = MilvusClient(uri="db/milvus_db.db")

---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
    [... skipping hidden 1 frame]

Cell In[23], line 2
      1 from pymilvus import MilvusClient
----> 2 milvus_client = MilvusClient(uri="db/milvus_db.db")

File ~\AppData\Roaming\Python\Python312\site-packages\pymilvus\milvus_client\milvus_client.py:64, in MilvusClient.__init__(self, uri, user, password, db_name, token, timeout, **kwargs)
     52 """A client for the common Milvus use case.
     53 
     54 This client attempts to hide away the complexity of using Pymilvus. In a lot ofcases what
   (...)     62         to None.
     63 """
---> 64 self._using = self._create_connection(
     65     uri, user, password, db_name, token, timeout=timeout, **kwargs
     66 )
     67 self.is_self_hosted = bool(utility.get_server_type(using=self._using) == "milvus")

File ~\AppData\Roaming\Python\Python312\site-packages\pymilvus\milvus_client\milvus_client.py:917, in MilvusClient._create_connection(self, uri, user, password, db_name, token, **kwargs)
    916     logger.error("Failed to create new connection using: %s", using)
--> 917     raise ex from ex
    918 else:

File ~\AppData\Roaming\Python\Python312\site-packages\pymilvus\milvus_client\milvus_client.py:914, in MilvusClient._create_connection(self, uri, user, password, db_name, token, **kwargs)
    913 try:
--> 914     connections.connect(using, user, password, db_name, token, uri=uri, **kwargs)
    915 except Exception as ex:

File ~\AppData\Roaming\Python\Python312\site-packages\pymilvus\orm\connections.py:388, in Connections.connect(self, alias, user, password, db_name, token, _async, **kwargs)
    384     raise ConnectionConfigException(
    385         message=f"Open local milvus failed, dir: {parent_path} not exists"
    386     )
--> 388 from milvus_lite.server_manager import (
    389     server_manager_instance,
    390 )
    392 local_uri = server_manager_instance.start_and_get_uri(kwargs["uri"])

ModuleNotFoundError: No module named 'milvus_lite'

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

ModuleNotFoundError                       Traceback (most recent call last)
    [... skipping hidden 1 frame]

Cell In[23], line 2
      1 from pymilvus import MilvusClient
----> 2 milvus_client = MilvusClient(uri="db/milvus_db.db")

File ~\AppData\Roaming\Python\Python312\site-packages\pymilvus\milvus_client\milvus_client.py:64, in MilvusClient.__init__(self, uri, user, password, db_name, token, timeout, **kwargs)
     52 """A client for the common Milvus use case.
     53 
     54 This client attempts to hide away the complexity of using Pymilvus. In a lot ofcases what
   (...)     62         to None.
     63 """
---> 64 self._using = self._create_connection(
     65     uri, user, password, db_name, token, timeout=timeout, **kwargs
     66 )
     67 self.is_self_hosted = bool(utility.get_server_type(using=self._using) == "milvus")

File ~\AppData\Roaming\Python\Python312\site-packages\pymilvus\milvus_client\milvus_client.py:917, in MilvusClient._create_connection(self, uri, user, password, db_name, token, **kwargs)
    916     logger.error("Failed to create new connection using: %s", using)
--> 917     raise ex from ex
    918 else:

File ~\AppData\Roaming\Python\Python312\site-packages\pymilvus\milvus_client\milvus_client.py:914, in MilvusClient._create_connection(self, uri, user, password, db_name, token, **kwargs)
    913 try:
--> 914     connections.connect(using, user, password, db_name, token, uri=uri, **kwargs)
    915 except Exception as ex:

File ~\AppData\Roaming\Python\Python312\site-packages\pymilvus\orm\connections.py:388, in Connections.connect(self, alias, user, password, db_name, token, _async, **kwargs)
    384     raise ConnectionConfigException(
    385         message=f"Open local milvus failed, dir: {parent_path} not exists"
    386     )
--> 388 from milvus_lite.server_manager import (
    389     server_manager_instance,
    390 )
    392 local_uri = server_manager_instance.start_and_get_uri(kwargs["uri"])

ModuleNotFoundError: No module named 'milvus_lite'

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

ModuleNotFoundError                       Traceback (most recent call last)
Cell In[23], line 2
      1 from pymilvus import MilvusClient
----> 2 milvus_client = MilvusClient(uri="db/milvus_db.db")

File ~\AppData\Roaming\Python\Python312\site-packages\pymilvus\milvus_client\milvus_client.py:64, in MilvusClient.__init__(self, uri, user, password, db_name, token, timeout, **kwargs)
     42 def __init__(
     43     self,
     44     uri: str = "http://localhost:19530",
   (...)     50     **kwargs,
     51 ) -> None:
     52     """A client for the common Milvus use case.
     53 
     54     This client attempts to hide away the complexity of using Pymilvus. In a lot ofcases what
   (...)     62             to None.
     63     """
---> 64     self._using = self._create_connection(
     65         uri, user, password, db_name, token, timeout=timeout, **kwargs
     66     )
     67     self.is_self_hosted = bool(utility.get_server_type(using=self._using) == "milvus")

File ~\AppData\Roaming\Python\Python312\site-packages\pymilvus\milvus_client\milvus_client.py:917, in MilvusClient._create_connection(self, uri, user, password, db_name, token, **kwargs)
    915 except Exception as ex:
    916     logger.error("Failed to create new connection using: %s", using)
--> 917     raise ex from ex
    918 else:
    919     logger.debug("Created new connection using: %s", using)

File ~\AppData\Roaming\Python\Python312\site-packages\pymilvus\milvus_client\milvus_client.py:914, in MilvusClient._create_connection(self, uri, user, password, db_name, token, **kwargs)
    912 using = uuid4().hex
    913 try:
--> 914     connections.connect(using, user, password, db_name, token, uri=uri, **kwargs)
    915 except Exception as ex:
    916     logger.error("Failed to create new connection using: %s", using)

File ~\AppData\Roaming\Python\Python312\site-packages\pymilvus\orm\connections.py:388, in Connections.connect(self, alias, user, password, db_name, token, _async, **kwargs)
    383 if not parent_path.is_dir():
    384     raise ConnectionConfigException(
    385         message=f"Open local milvus failed, dir: {parent_path} not exists"
    386     )
--> 388 from milvus_lite.server_manager import (
    389     server_manager_instance,
    390 )
    392 local_uri = server_manager_instance.start_and_get_uri(kwargs["uri"])
    393 if local_uri is None:

ModuleNotFoundError: No module named 'milvus_lite'

在Github 有人提出了:

[Bug]: Can't use MilvusClient() because it says "ModuleNotFoundError: No module named 'milvus_lite'" · Issue #34854 · milvus-io/milvus

ModuleNotFoundError: No module named 'milvus_lite'

Milvus_lite还不支持在Windows上运行

相关推荐
老邓计算机毕设20 小时前
SSM学生选课系统xvbna(程序+源码+数据库+调试部署+开发环境)带论文文档1万字以上,文末可获取,系统界面在最后面
数据库·学生选课系统·ssm 框架·高校教学管理
带刺的坐椅20 小时前
Solon AI Skills 会是 Agent 的未来吗?
java·agent·langchain4j·solon-ai
jacGJ20 小时前
记录学习--文件读写
java·前端·学习
花间相见20 小时前
【JAVA开发】—— Nginx服务器
java·开发语言·nginx
扶苏-su21 小时前
Java---Properties 类
java·开发语言
枷锁—sha21 小时前
【PortSwigger Academy】SQL 注入绕过登录 (Login Bypass)
数据库·sql·学习·安全·网络安全
cypking21 小时前
四、CRUD操作指南
java
2301_780669861 天前
文件字节流输出、文件复制、关闭流的方法
java
剑锋所指,所向披靡!1 天前
C++之类模版
java·jvm·c++
逍遥德1 天前
PostgreSQL 中唯一约束(UNIQUE CONSTRAINT) 和唯一索引(UNIQUE INDEX) 的核心区别
数据库·sql·postgresql·dba