-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Open
Labels
kind/bugIssues or changes related a bugIssues or changes related a bugneeds-triageIndicates an issue or PR lacks a `triage/foo` label and requires one.Indicates an issue or PR lacks a `triage/foo` label and requires one.
Description
Is there an existing issue for this?
- I have searched the existing issues
Environment
- Python 3.11
- pymilvus 2.6.x
- milvus-lite (installed via pip install pymilvus[milvus_lite])
- setuptools 82.0.1
Current Behavior
1. Error
File ".../milvus_lite/__init__.py", line 15, in <module>
from pkg_resources import DistributionNotFound, get_distribution
ModuleNotFoundError: No module named 'pkg_resources'
2. Root Cause
milvus_lite/__init__.py uses from pkg_resources import ..., which is
deprecated and may not be importable in some environments even when setuptools
is installed (known issue with certain conda/venv setups).
3. Workaround (local patch only — not a permanent fix)
Edit milvus_lite/__init__.py (find the path with pip show milvus-lite):
Before (line 15):
from pkg_resources import DistributionNotFound, get_distribution After:
from importlib.metadata import PackageNotFoundError as DistributionNotFound,
version as _imeta_version
def get_distribution(name):
class _D:
def __init__(self, v): self.version = v
return _D(_imeta_version(name)) 4. Verify
python -c "from pymilvus import MilvusClient; print('OK')"Note: This workaround only patches the local installation. The proper fix
is to replacepkg_resourceswithimportlib.metadatain themilvus-lite
source, aspkg_resourceshas been deprecated by
setuptools.
Expected Behavior
MilvusClient connects successfully without ModuleNotFoundError.
Steps To Reproduce
pip install "pymilvus[milvus_lite]"
python -c "from pymilvus import MilvusClient; MilvusClient(uri='test.db')"
Milvus Log
No response
Anything else?
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
kind/bugIssues or changes related a bugIssues or changes related a bugneeds-triageIndicates an issue or PR lacks a `triage/foo` label and requires one.Indicates an issue or PR lacks a `triage/foo` label and requires one.