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

相关推荐
韩立学长2 小时前
基于Springboot建筑物保护可视化系统rk6tni53(程序、源码、数据库、调试部署方案及开发环境)系统界面展示及获取方式置于文档末尾,可供参考。
数据库·spring boot·后端
量化风云2 小时前
2026量化新基建(二) - sqlite 与 sqlite-utils
数据库·python·sqlite·量化交易·量化交易课程
yyy(十一月限定版)2 小时前
C++基础
java·开发语言·c++
Coder_Boy_2 小时前
分布式系统设计经验总结:金融vs电商的核心差异与决策思路
java·运维·微服务·金融·电商
code tsunami2 小时前
如何将 Helium 与 CapSolver 集成,实现无缝 CAPTCHA 自动化解决
运维·数据库·人工智能·爬虫·python·自动化
AI科技星2 小时前
空间螺旋电磁耦合常数 Z‘:拨开迷雾,让电磁力变得直观易懂
服务器·人工智能·科技·算法·生活
To Be Clean Coder2 小时前
【Spring源码】getBean源码实战(一)
java·后端·spring
派大鑫wink2 小时前
【Day21】NIO入门:通道、缓冲区与非阻塞IO基础
java·开发语言
ziyue75752 小时前
idea将配置移动到自定义位置
java·intellij-idea·idea·软件