Skip to content

Commit 96aa964

Browse files
committed
fix: Automatic installation when the dependent package does not exist
1 parent 8268392 commit 96aa964

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

milvus/__init__.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,12 @@
66
import pathlib
77
import shutil
88
import os
9-
from importlib_resources import files
109
from distutils.dir_util import copy_tree
10+
try:
11+
from importlib_resources import files
12+
except ModuleNotFoundError:
13+
os.system("pip install importlib_resources")
14+
from importlib_resources import files
1115

1216
CONFIG_PATH = '/var/bin/e-milvus/configs/'
1317
LIB_PATH = '/var/bin/e-milvus/lib/'

0 commit comments

Comments
 (0)