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

相关推荐
80530单词突击赢10 分钟前
JavaWeb进阶:SpringBoot核心与Bean管理
java·spring boot·后端
Thera77722 分钟前
【Linux C++】彻底解决僵尸进程:waitpid(WNOHANG) 与 SA_NOCLDWAIT
linux·服务器·c++
爬山算法30 分钟前
Hibernate(87)如何在安全测试中使用Hibernate?
java·后端·hibernate
呉師傅41 分钟前
【使用技巧】Adobe Photoshop 2024调整缩放与布局125%后出现点菜单项漂移问题的简单处理
运维·服务器·windows·adobe·电脑·photoshop
云姜.42 分钟前
线程和进程的关系
java·linux·jvm
是码龙不是码农44 分钟前
支付防重复下单|5 种幂等性设计方案(从初级到架构级)
java·架构·幂等性
曹牧44 分钟前
Spring Boot:如何在Java Controller中处理POST请求?
java·开发语言
heartbeat..44 分钟前
JVM 性能调优流程实战:从开发规范到生产应急排查
java·运维·jvm·性能优化·设计规范
WeiXiao_Hyy1 小时前
成为 Top 1% 的工程师
java·开发语言·javascript·经验分享·后端
玄同7651 小时前
SQLite + LLM:大模型应用落地的轻量级数据存储方案
jvm·数据库·人工智能·python·语言模型·sqlite·知识图谱