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上运行

相关推荐
zh15702314 小时前
JavaScript中WorkerThreads解决服务端计算瓶颈
jvm·数据库·python
代码AI弗森14 小时前
一文理清楚“算力申请 / 成本测算 / 并发评估”
java·服务器·数据库
Old Uncle Tom14 小时前
OpenClaw 记忆系统 -- 记忆预加载
java·数据结构·算法·agent
小小小米粒14 小时前
Collection单列集合、Map(Key - Value)双列集合,多继承实现。
java·开发语言·windows
^—app56686615 小时前
游戏运存小启动不起来临时解决方法
运维·服务器
摇滚侠15 小时前
expdp 查看帮助
java·数据库·oracle
流年似水~15 小时前
MCP协议实战:从零搭建一个让Claude能“看见“数据库的工具服务
数据库·人工智能·程序人生·ai·ai编程
2401_8714928515 小时前
Vue.js监听器watch利用回调函数处理级联下拉框数据联动
jvm·数据库·python
:12115 小时前
java基础
java·开发语言
志栋智能15 小时前
超自动化安全:构建智能安全运营的核心引擎
大数据·运维·服务器·数据库·安全·自动化·产品运营