Try moving the environment.yaml to the sd folder before installing

This commit is contained in:
cmdr2 2022-10-10 20:12:02 +05:30
parent e521b350ca
commit 1c5352203d

View File

@ -1,24 +1,28 @@
import os import os
import platform import platform
import shutil
from installer import app, helpers from installer import app, helpers
def run(): def run():
environment_file_path = get_environment_file_path()
local_env_file_path = os.path.join(app.stable_diffusion_repo_dir_path, 'environment.yaml')
shutil.copy(environment_file_path, local_env_file_path)
if is_valid_env(): if is_valid_env():
helpers.log("Packages necessary for Stable Diffusion were already installed") helpers.log("Packages necessary for Stable Diffusion were already installed")
return return
log_installing_header() log_installing_header()
environment_file_path = get_environment_file_path()
env = os.environ.copy() env = os.environ.copy()
env['PYTHONNOUSERSITE'] = '1' env['PYTHONNOUSERSITE'] = '1'
if not os.path.exists(app.project_env_dir_path): if not os.path.exists(app.project_env_dir_path):
helpers.run(f'micromamba create --prefix {app.project_env_dir_path}', log_the_cmd=True) helpers.run(f'micromamba create --prefix {app.project_env_dir_path}', log_the_cmd=True)
helpers.run(f'micromamba install -y --prefix {app.project_env_dir_path} -f {environment_file_path}', env=env, log_the_cmd=True, run_in_folder=app.stable_diffusion_repo_dir_path) helpers.run(f'micromamba install -y --prefix {app.project_env_dir_path} -f {local_env_file_path}', env=env, log_the_cmd=True, run_in_folder=app.stable_diffusion_repo_dir_path)
if is_valid_env(): if is_valid_env():
helpers.log("Installed the packages necessary for Stable Diffusion") helpers.log("Installed the packages necessary for Stable Diffusion")