Skip to content

Explicit is better than implicit: let user install the dependencies explicitly #86

Description

@shenxiangzhuang

Currently, when using milvus-model package, it will install the dependencies implicitly using pip:

def prompt_install(package: str, warn: bool = False): # pragma: no cover
cmd = f"pip install -q {package}"
try:
if warn and input(f"Install {package}? Y/n: ") != "Y":
raise ModuleNotFoundError(f"No module named {package}")
print(f"start to install package: {package}")
subprocess.check_call(cmd, shell=True)
print(f"successfully installed package: {package}")
except subprocess.CalledProcessError as e:
raise ValueError(f"install error {e}")

But the user may not use pip to manage there env at all... When the log says that successfully installed package: xxx, which actually means successfully installed(by pip) package: xxx . So current log message will confuse the user IMO.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions