diff options
author | AUTOMATIC <16777216c@gmail.com> | 2022-09-13 14:32:40 +0000 |
---|---|---|
committer | AUTOMATIC <16777216c@gmail.com> | 2022-09-13 14:32:40 +0000 |
commit | 918a092ed4be0f0320c714ca56d61ab073e1c58e (patch) | |
tree | ca0275d3d8dcb8dc0a0c4868df9aa57c1fda719e /launch.py | |
parent | a5f34b46369beae8ae5c102d538cc13ca44be7b6 (diff) | |
download | stable-diffusion-webui-gfx803-918a092ed4be0f0320c714ca56d61ab073e1c58e.tar.gz stable-diffusion-webui-gfx803-918a092ed4be0f0320c714ca56d61ab073e1c58e.tar.bz2 stable-diffusion-webui-gfx803-918a092ed4be0f0320c714ca56d61ab073e1c58e.zip |
emergency fix for running in dir with spaces
Diffstat (limited to 'launch.py')
-rw-r--r-- | launch.py | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -47,11 +47,11 @@ stderr: {result.stderr.decode(encoding="utf8", errors="ignore") if len(result.st def run_python(code, desc=None, errdesc=None):
- return run(f'{python} -c "{code}"', desc, errdesc)
+ return run(f'"{python}" -c "{code}"', desc, errdesc)
def run_pip(args, desc=None):
- return run(f'{python} -m pip {args} --prefer-binary', desc=f"Installing {desc}", errdesc=f"Couldn't install {desc}")
+ return run(f'"{python}" -m pip {args} --prefer-binary', desc=f"Installing {desc}", errdesc=f"Couldn't install {desc}")
def check_run(command):
@@ -60,7 +60,7 @@ def check_run(command): def check_run_python(code):
- return check_run(f'{python} -c "{code}"')
+ return check_run(f'"{python}" -c "{code}"')
def is_installed(package):
@@ -78,10 +78,10 @@ def git_clone(url, dir, name, commithash=None): if os.path.exists(dir):
return
- run(f'{git} clone "{url}" "{dir}"', f"Cloning {name} into {dir}...", f"Couldn't clone {name}")
+ run(f'"{git}" clone "{url}" "{dir}"', f"Cloning {name} into {dir}...", f"Couldn't clone {name}")
if commithash is not None:
- run(f"{git} -C {dir} checkout {commithash}", None, "Couldn't checkout {name}'s hash: {commithash}")
+ run(f'"{git}" -C {dir} checkout {commithash}', None, "Couldn't checkout {name}'s hash: {commithash}")
try:
@@ -93,7 +93,7 @@ print(f"Python {sys.version}") print(f"Commit hash: {commit}")
if not is_installed("torch"):
- run(f"{python} -m {torch_command}", "Installing torch", "Couldn't install torch")
+ run(f'"{python}" -m {torch_command}', "Installing torch", "Couldn't install torch")
run_python("import torch; assert torch.cuda.is_available(), 'Torch is not able to use GPU'")
|