From 89102b9c016786873b3863e39673659611fe7770 Mon Sep 17 00:00:00 2001 From: Saifeddine ALOUI Date: Mon, 11 Mar 2024 14:15:07 +0100 Subject: [PATCH] Update utilities.py --- lollms/utilities.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lollms/utilities.py b/lollms/utilities.py index 31d209d..83ae524 100644 --- a/lollms/utilities.py +++ b/lollms/utilities.py @@ -38,13 +38,14 @@ import git import mimetypes import subprocess -from conda.cli.python_api import run_command, Commands def create_conda_env(env_name, python_version): + from conda.cli.python_api import run_command, Commands # Create a new Conda environment with the specified Python version run_command(Commands.CREATE, "-n", env_name, f"python={python_version}") def run_python_script_in_env(env_name, script_path, cwd=None): + from conda.cli.python_api import run_command, Commands # Set the current working directory if provided, otherwise use the current directory if cwd is None: cwd = os.getcwd() @@ -53,6 +54,7 @@ def run_python_script_in_env(env_name, script_path, cwd=None): run_command(Commands.RUN, "-n", env_name, "python", str(script_path), cwd=cwd) def run_script_in_env(env_name, script_path, cwd=None): + from conda.cli.python_api import run_command, Commands # Set the current working directory if provided, otherwise use the current directory if cwd is None: cwd = os.path.dirname(script_path)