move venv import from file level to class level to avoid import error… (#575)

Link: https://code.alibaba-inc.com/Ali-MaaS/MaaS-lib/codereview/14301042
* move venv import from file level to class level to avoid import error… (#575)

* move venv import from file level to class level to avoid import error on windows


---------

authored-by: Zhicheng Zhang <zhangzhicheng.zzc@alibaba-inc.com>
This commit is contained in:
mulin.lyh
2023-10-13 22:27:51 +08:00
parent 6e424cdb69
commit 049bde9ddf

View File

@@ -9,7 +9,6 @@ import os
import pkgutil
import shutil
import sys
import venv
from contextlib import contextmanager
from fnmatch import fnmatch
from pathlib import Path
@@ -1144,6 +1143,7 @@ class EnvsManager(object):
cfg = read_config(model_dir)
self.plugins = cfg.get('plugins', [])
self.allow_remote = cfg.get('allow_remote', False)
import venv
self.env_builder = venv.EnvBuilder(
system_site_packages=True,
clear=False,