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

* pass lint check

---------

Co-authored-by: Zhicheng Zhang <zhangzhicheng.zzc@alibaba-inc.com>
This commit is contained in:
Zhicheng Zhang
2023-10-08 13:36:34 +08:00
committed by GitHub
parent d88898e477
commit 43046a719b

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,